Articles in this section
Category / Section

How to show the caption text at end of the grid in WinForms GridGroupingControl?

2 mins read

Show the caption text


By default, there is no support for showing the Caption at the end of the Grid. In order to show the caption text at the end of the WinForms GridGroupingControlGroupFooterSection can be used (which will be displayed at the end of the table) and cell value of Group Footer Section cell is assigned to CaptionText.


C#

//Display the GroupFooter cell
this.gridGroupingControl1.TopLevelGroupOptions.ShowGroupFooter = true;

//Set the caption text to be displayed
String CaptionText = this.gridGroupingControl1.TableDescriptor.Name + ":" + this.gridGroupingControl1.Table.Records.Count + " Items";
this.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellValue = CaptionText;

//Disable the editing
this.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellType = GridCellTypeName.Static;

//Set the height of the GroupCaption
this.gridGroupingControl1.TableOptions.GroupFooterSectionHeight = 20; 

VB

'Display the GroupFooter cell
Me.gridGroupingControl1.TopLevelGroupOptions.ShowGroupFooter = True

'Set the caption text to be displayed
Dim CaptionText As String = Me.gridGroupingControl1.TableDescriptor.Name & ":" & Me.gridGroupingControl1.Table.Records.Count & " Items"
Me.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellValue = CaptionText

'Disable the editing
Me.gridGroupingControl1.Appearance.GroupFooterSectionCell.CellType = GridCellTypeName.Static

'Set the height of the GroupCaption 
Me.gridGroupingControl1.TableOptions.GroupFooterSectionHeight = 20

The Screenshot below displays the caption text at the end of the grid.

Show the caption text at end of the grid























Samples:

C#: Show_CaptionText_CS

VB: Show_CaptionText_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied