Class GridHierarchyLevel
The GridHierarchyLevel class holds information about a hierarchy level in a grid. A grid has at least one root level. If there are nested relations inside the grid the grid will hold an additional GridHierarchyLevel for each relation.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridHierarchyLevel
Remarks
The grid provides access to GridHierarchyLevel though the RootHierarchyLevel property and GetHierarchyLevel(String) and AddRelation(String) functions of a Binder.
HierarchyLevelCount will provide you with number of hierarchy levels.
Properties
GridBoundColumns
Gets or sets a collection of GridBoundColumn objects in the GridDataBoundGrid control.
Declaration
public GridBoundColumnsCollection GridBoundColumns { get; set; }
Property Value
| Type |
|---|
| GridBoundColumnsCollection |
HeaderStyle
Gets the appearance of column headers for rows that belong to this relation.
Declaration
public GridStyleInfo HeaderStyle { get; }
Property Value
| Type |
|---|
| GridStyleInfo |
LevelIndex
Gets the zero-based index for this hierarchy level.
Declaration
public int LevelIndex { get; }
Property Value
| Type |
|---|
| System.Int32 |
Relation
Gets Relation descriptor for sublevel
Declaration
public PropertyDescriptor Relation { get; }
Property Value
| Type |
|---|
| System.ComponentModel.PropertyDescriptor |
RowCountPerRecord
Gets Number of rows per record.
Declaration
public int RowCountPerRecord { get; }
Property Value
| Type |
|---|
| System.Int32 |
RowStyle
Gets the appearance of rows that belong to this relation.
Declaration
public GridStyleInfo RowStyle { get; }
Property Value
| Type |
|---|
| GridStyleInfo |
ShowHeaders
Gets or sets a value indicating whether headers for this relation should be shown or hidden.
Declaration
public bool ShowHeaders { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
FieldToRowField(Int32, out Int32)
Calculates the zero-based row index in the record and the zero-based field column in the grid base on a zero-based field number that can be used as an index in the Syncfusion.Windows.Forms.Grid.GridHierarchyLevel.InternalColumns.
Declaration
public int FieldToRowField(int fieldNum, out int row)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | fieldNum | A field number that can be used as an index in the Syncfusion.Windows.Forms.Grid.GridHierarchyLevel.InternalColumns. |
| System.Int32 | row | Returns the zero-based row index in the record. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Returns the zero-based field number in the grid. You can call FieldToColIndex(Int32) to get the associated column index. |
GetColCount()
Returns the number of columns that this relation displays in the grid. If a record is broken into several rows, the column count will be the maximum column count for all rows in the record.
Declaration
public int GetColCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of columns that this relation displays in the grid. |
LayoutColumns(String[])
Rearranges how columns are displayed in the grid and allows you to specify covered cells and / or break records into several rows displayed in the grid.
Declaration
public void LayoutColumns(string[] mappingNames)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String[] | mappingNames | A string array with field names. The following strings have a specific meaning: "-" specifies a covered cell. "." indicated line break inside the record. Subsequent fields will be displayed in another row. "" specifies an empty "whitespace" column. Other than these, you should use the same mapping names that you also use with GridBoundColumn objects. |
Examples
See the "MultiRowRecord" and "ExpandGrid" examples for sample code.
RowFieldToField(Int32, Int32)
Calculates a zero-based field number that can be used as an index in the Syncfusion.Windows.Forms.Grid.GridHierarchyLevel.InternalColumns based on the zero-based row index in the record and the zero-based field column in the grid.
Declaration
public int RowFieldToField(int row, int fieldNum)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | row | Zero-base row index. |
| System.Int32 | fieldNum | Zero-based field index in the grid. If you have an absolute column index, you should first convert it with ColIndexToField(Int32). |
Returns
| Type | Description |
|---|---|
| System.Int32 | A zero-based field number that can be used as an index to access a GridBoundColumn in Syncfusion.Windows.Forms.Grid.GridHierarchyLevel.InternalColumns. |
Events
GridBoundColumnsChanged
Occurs when columns have been added or removed.
Declaration
public event EventHandler GridBoundColumnsChanged
Event Type
| Type |
|---|
| System.EventHandler |