Owl's Blog on .NET development

Component Owl codes Better ListView control all night so you don't have to.

Hiding Column Headers in Better ListView

Better ListView 3.2.0 and newer supports hiding column headers but keeping sub-items visible:

Hiding Column Headers

Hiding Column Headers

To hide column headers, simply set HeaderStyle property to BetterListViewHeaderStyle.None. There are other possible styles for all column headers:

  • None – column headers are hidden, but corresponding sub-items are still visible
  • Nonclickable – column headers are visible, but not interactive
  • Clickable – column headers interact with mouse (have hot and pressed state)
  • Sortable – column headers are clickable and sort the corresponding column when clicked
  • Unsortable – same as Sortable, but the column headers have unsorted state as well
  • Hidden – column headers are hidden with corresponding sub-items

These styles can be set on individual column headers as well through BetterListViewColumnHeader.Style property. This property is of type BetterListViewColumnHeaderStyle, which has the same values as BetterListViewHeaderStyle, plus Default value, which means that column header style is inherited from the HeaderStyle property.

When a single column header have style None, that column header is not drawn (only its background is visible) and corresponding sub-items are visible.

When all column headers have style None,  the whole panel with column headers hides (as seen on the above animation) and the sub-items remain visible. This effect is the as when all column headers have style Default and HeaderStyle is set to None.

Leave a Reply