Gets or sets the column header style.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The property allows you to specify the type of column headers to display when the View property of the ListView control is set to Details and the ListView control has ColumnHeader objects specified in the ListView.ColumnHeaderCollection. ColumnHeader objects define the columns that are displayed in the ListView control. Each column is used to display subitem information for each item in the ListView.
The property allows you to specify whether the column headers are visible or, if they are visible, whether they will function as clickable buttons. If the property is set to ColumnHeaderStyle.None, the column headers are not displayed, although the items and subitems of the ListView control are still arranged in columns. If the property is set to ColumnHeaderStyle.Clickable, the column headers act like buttons that users can click to carry out an action, such as sorting the items in the ListView control using the items in the clicked column as a key. You can implement this behavior in a handler for the ColumnClick event. If the property is set to ColumnHeaderStyle.Nonclickable, the column headers appear, but cannot be clicked.
The following code example demonstrates a ListView that allows multiple items to be selected. The example demonstrates setting the HideSelection and properties. It also demonstrates the ColumnHeader.Text, ColumnHeader.TextAlign and ColumnHeader.Width properties. To run this example, paste the following code into a form that contains a ListView object named ListView1 and a TextBox named TextBox1. Call the InitializeListView method from the form's constructor or Load event handler.