Gets the header collection.
Namespace: Dapfor.Wpf.ControlsAssembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)
Syntax
C# |
---|
public HeaderCollection Headers { get; } |
Visual Basic |
---|
Public ReadOnly Property Headers As HeaderCollection Get |
Visual C++ |
---|
public: property HeaderCollection^ Headers { HeaderCollection^ get (); } |
F# |
---|
member Headers : HeaderCollection with get |
Property Value
Type: HeaderCollectionThe header collection.
Remarks
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 | |
---|---|
<!-- XAML --> <df:Header> <df:Header.Columns> <df:Column Id="Id0" Title="Column 0"/> <df:Column Id="Id1" Title="Column 1"/> <df:Column Id="Id2" Title="Column 2"/> </df:Header.Columns> </df:Header> //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 | |
---|---|
//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]; |