ListViewColumnHeaders Collection
Description
A ListViewColumnHeaders collection contains one or more ColumnHeader objects.
For a list of all members defined in this module, see ListViewColumnHeaders Members.
Object Model



Remarks
You can view ColumnHeader objects in Report view only. You can add ColumnHeader objects to a ListView control at both design time and run time.
With a ListViewColumnHeader object, a user can:
- Click it to trigger the
ColumnClickevent and sort the items based on that data item. - Grab the object's right border and drag it to adjust the width of the column.
- Hide
ListViewColumnHeaderobjects in Report view.
There is always one column in the ListView control, which is Column 1. This column contains the actual ListViewItem objects, not their subitems. The second column (Column 2) contains subitems. Therefore, you always have one more ListViewColumnHeader object than subitems, and the ListViewItem object's SubItems property is a 1-based array of size ListViewColumnHeader.Count - 1.
The number of ListViewColumnHeader objects determines the number of subitems each ListViewItem object in the control can have. When you delete a ListViewColumnHeader object, all of the subitems associated with the column are also deleted, and each ListViewItem object's subitem array shifts to update the indices of the ListViewColumnHeader, causing the remaining column headers' SubItemIndex properties to change.
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.