Gets the header collection.

Namespace: Dapfor.Wpf.Controls
Assembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: (


public HeaderCollection Headers { get; }
Visual Basic
Public ReadOnly Property Headers As HeaderCollection
Visual C++
property HeaderCollection^ Headers {
	HeaderCollection^ get ();
member Headers : HeaderCollection with get

Property Value

Type: HeaderCollection
The header collection.


In GridControl headers are used for storing columns that can be used to manage content display and grouping and to display content with different presentations on different hierarchy levels.

There can be one or more headers, and therefore the grid can operate either in TreeList mode like Windows Explorer or as a fully functional grid with multiple independent headers. Header columns are added both in XAML and in C# or VB code.

 Copy imageCopy
<!-- XAML -->
    <df:Column Id="Id0" Title="Column 0"/> 
    <df:Column Id="Id1" Title="Column 1"/> 
    <df:Column Id="Id2" Title="Column 2"/> 

 //C# code
 Header header = new Header(); 
 header.Add(new Column("Id0", "Column 0")); 
 header.Add(new Column("Id1", "Column 1")); 
 header.Add(new Column("Id2", "Column 2"));

The header provides several convenient accessories to control and manage sequence, column visibility and data grouping. The following code demonstrates a way of receiving all header columns (both visible and invisible).

 Copy imageCopy
//Some code here... 
Header header = ...; 

//Enumerate all columns in header 
foreach (Column column in header.Columns) 
  //Some code here... 

//Enumerate all grouped columns 
foreach (Column column in header.GroupedColumns) 
    //Some code here... 

//Enumerate all sorted columns 
foreach (Column column in header.SortedColumns) 
    //Some code here... 

//Find a column by its identifier or position: 
Column column1 = header["MyColumn"]; 
Column column2 = header[5];

See Also