Skip to content

ListViewColumnHeader Object

Description

A ListViewColumnHeader object is an item in a ListView control that contains heading text.

For a list of all members defined in this module, see ListViewColumnHeader Members.

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 ColumnClick event 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 ListViewColumnHeader objects 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

ListViewColumnHeader Members


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.