How to change the caption text in Windows Forms GridGroupingControl

15 Jun 20211 minute to read

This can be done using the code below.

  • C#
  • // Sets the caption text.
    // {TableName} - Displays the CaptionSection.ParentTableDescriptor.Name
    //{CategoryName} - Displays the CaptionSection.ParentGroup.Name
    //{Category} - Displays the CaptionSection.ParentGroup.Category
    //{RecordCount} - Displays the CaptionSection.ParentGroup.GetFilteredRecordCount()
    this.gridGroupingControl1.TopLevelGroupOptions.CaptionText = "Table name is {TableName} : {Category} : {RecordCount}";
  • VB
  • 'Sets the caption text.
    ' {TableName} - Displays the CaptionSection.ParentTableDescriptor.Name
    '{CategoryName} - Displays the CaptionSection.ParentGroup.Name
    '{Category} - Displays the CaptionSection.ParentGroup.Category
    '{RecordCount} - Displays the CaptionSection.ParentGroup.GetFilteredRecordCount()
    Me.gridGroupingControl1.TopLevelGroupOptions.CaptionText = "Table name is {TableName} : {Category} : {RecordCount}"