The grid as well as each group in the grid has header and footer sections in which rows can be added. These rows are normally used to manage groups or columns, display summaries, text labels or any other desired information.
The grid has both fixed header and footer sections that will not scroll with the grid content as well as headers and footers that will scroll with the grid content. To add fixed header and/or footer rows to the grid, rows, such as a TextRow row or a ColumnManager row, can be used. These rows are added using either the FixedHeaderRows or FixedFooterRows properties (see Example 1). Headers and footers that scroll with the grid content, can be added via the HeaderRows and FooterRows properties (see Example 2 ).
The header and footer rows of a group are not fixed and will scroll with the grid content. To add header and/or footer rows to a group, rows such as a Text row or a GroupManager row, can be used. These rows are added using either the HeaderRows of FooterRows properties (see Example 3).
Example 1: Adding rows to the fixed headers and footers
VB.NET |
Copy Code |
---|---|
Dim grid As New GridControl() grid.FixedHeaderRows.Add( New ColumnManagerRow() ) grid.FixedFooterRows.Add( New TextRow( "Grid Fixed Footer" ) ) Me.Controls.Add( grid ) |
C# |
Copy Code |
---|---|
GridControl grid = new GridControl(); grid.FixedHeaderRows.Add( new ColumnManagerRow() ); grid.FixedFooterRows.Add( new TextRow( "Grid Fixed Footer" ) ); this.Controls.Add( grid ); |
Example 2: Adding rows to the headers and footers (scrollable)
VB.NET |
Copy Code |
---|---|
Dim grid As New GridControl() grid.HeaderRows.Add( New InsertionRow() ) grid.FooterRows.Add( New TextRow( "Grid Scrollable Footer" ) ) Me.Controls.Add( grid ) |
C# |
Copy Code |
---|---|
GridControl grid = new GridControl(); grid.HeaderRows.Add( new InsertionRow() ); grid.FooterRows.Add( new TextRow( "Grid Scrollable Footer" ) ); this.Controls.Add( grid ); |
Example 3: Adding rows the group headers and footers
VB.NET |
Copy Code |
---|---|
Dim group As New Group() group.HeaderRows.Add( New GroupManagerRow() ) group.FooterRows.Add( New TextRow( "Group Footer" ) ) |
C# |
Copy Code |
---|---|
Group group = new Group() ; group.HeaderRows.Add( new GroupManagerRow() ); group.FooterRows.Add( new TextRow( "Group Footer" ) ); |