Columns

Displaying/Hiding all Column Headers

To display column headers in other views than Details, set ColumnsDisplayMode property to ShowAlways. The default value is ShowDetails (show column headers in Details view only). Setting the property to Hide hides all column headers.

Following image shows column headers displayed in Tile view:

To hide specific columns only, see Hiding Custom Columns below.

Column Header Styles

Each column header can have one of three styles defined by BetterListViewColumnHeader.Style property:

Hiding Custom Columns



Custom column hiding feature is not available in Better ListView Express.



One way to hide a column would be simply removing it from Columns collection. When there are items with sub-items, however, this approach requires removing also all the sub-items for the corresponding removed column.

When you need to just visually hide a column and corresponding sub-items (without removing them), call BetterListViewColumnHeader.Hide() method. To re-show hidden column, call BetterListViewColumnHeader.Show(). The same can be obtained by setting BetterListViewColumnHeader.Visible property.

The following images show hiding some column in application which uses cotext menu for this action:

Column Resizing

Columns are resizable by default. There are two properties for setting-up this feature on each column:

Values of these properties depend upon each other and the BetterListViewColumnHeader.Width property. This is because the minimum width have to be always smaller than the maximum width and the column width have to lay between the two extremes.

To disable column resizing for a given column, set BetterListViewColumnHeader.AllowResize to false.

To detect column width adjustment, use the ColumnWidthChanging and ColumnWidthChanged events.



Column header can have zero minimum width. In that case, it is possible to completely hide the column header. If several neighboring columns are collapsed this way, expanding them back is possible by dragging right side of a collapsed column header border.



Column Reordering



This feature is not available in Better ListView Express.



Column reordering is disabled by default, but se be set-up by simply settings ColumnReorderMode property to one of the following values:

ColumnReordered event is raised after column reordering is finished. The actual reordering consists of switching column items in the Columns collections and the corresponding sub-items in each row. This feature actually modifies data in the list, not only the visual part. If you need to do any other processing (e.g. switch item texts only), use custom reordering mode.