Click or drag to resize

ShellViewColumns Class

Class representing a collection of ShellViewColumns. It serves to control the visible columns in supported controls. Not supported on Windows XP.
Inheritance Hierarchy
SystemObject
  Jam.ShellShellViewColumns

Namespace:  Jam.Shell
Assembly:  ShellBrowser.Core (in ShellBrowser.Core.dll) Version: 6.2
Syntax
public class ShellViewColumns : IList<ShellViewColumn>, 
	ICollection<ShellViewColumn>, IEnumerable<ShellViewColumn>, IEnumerable, 
	INotifyCollectionChanged

The ShellViewColumns type exposes the following members.

Properties
Methods
  NameDescription
Public methodCode exampleAdd(SHCOLUMNID)
Adds the specified column at the last position.
Public methodAdd(ShellViewColumn)
Adds a column to the collection.
Public methodAutoSize
Resizes all columns to the auto-size width.
Public methodCode exampleClear
Public methodContains(SHCOLUMNID)
Determines whether the passed column is contained in the collection.
Public methodContains(ShellViewColumn)
Public methodCopyTo
Copies the entire list to the array passed, starting at the passed index of the target array.
Public methodDefaultSize
Resizes all columns to the default-size width.
Protected methodGetColumnName
Gets the caption of the column with the passed column key.
Protected methodGetColumnWidth
Returns the width of the column identified by the passed id.
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
Public methodGetSHColumnIds
Returns the columns the keys of the columns in collection.
Public methodHide
Removes the given column from the current view.
Public methodIndexOf(SHCOLUMNID)
Returns the index of the column with the passed SHCOLUMNID.
Public methodIndexOf(ShellViewColumn)
Public methodInsert(Int32, SHCOLUMNID)
Inserts a new column representing the passed SHCOLUMNID at the passed index.
Public methodInsert(Int32, ShellViewColumn)
Public methodRemove(SHCOLUMNID)
Removes the specified column.
Public methodCode exampleRemove(ShellViewColumn)
Public methodRemoveAt
Protected methodSetColumnName
Changes the name of the column identified by the passed id.
Public methodCode exampleSetColumns
Replaces the currently shown columns by the columns passed.
Protected methodSetColumnWidth
Sets the width of the column identified by the passed id.
Public methodCode exampleShow
Adds the column at its default position.
Top
Events
  NameDescription
Public eventCollectionChanged
Occurs when collection has changed.
Top
Examples
The following examples control the columns displayed in the ExplorerBrowser.
C#
explorerBrowser1.Columns.Clear();
explorerBrowser1.Columns.Add(SHCOLUMNID.ShellColumnName);
explorerBrowser1.Columns.Add(SHCOLUMNID.ShellColumnSize);
explorerBrowser1.Columns.Add(SHCOLUMNID.ShellColumnParentFolder);
C#
//if you want to define the total set of columns at once, this version is much more performant than adding each column seperately.
explorerBrowser1.Columns.SetColumns(new List<SHCOLUMNID>()
{
    SHCOLUMNID.ShellColumnName,
    SHCOLUMNID.ShellColumnSize,
    SHCOLUMNID.ShellColumnElementType
});
C#
if (IsMyMusic())
{
    //"Show" shows the column at its default position, but you can determine the position by using "Insert" or "Add"
    explorerBrowser1.Columns.Show(SHCOLUMNID.ShellColumnMusicTitlenumber);
    explorerBrowser1.Columns.Show(SHCOLUMNID.ShellColumnSummaryTitle);
    explorerBrowser1.Columns.Show(SHCOLUMNID.ShellColumnMusicArtist);
    explorerBrowser1.Columns.Show(SHCOLUMNID.ShellColumnMusicAlbum);
    explorerBrowser1.Columns.Show(SHCOLUMNID.ShellColumnMusicYear);
    explorerBrowser1.Columns[explorerBrowser1.Columns.Count - 1].Caption = "Custom title";
}
C#
explorerBrowser1.Columns.Remove(SHCOLUMNID.ShellColumnSize); //Removes the Size column. If it doesn't exist it is skipped.
See Also