Caption text for group headers

Hello,

I am using GridGroupingControl of Syncfusion version 6.3.1.8.I need to know how I can set any desired text for the group headers in GridGroupingControl.For eg caption for 1st group if "aaa", for second is "abc" etc.


1 Reply

JJ Jisha Joy Syncfusion Team November 25, 2008 11:30 AM UTC

Hi Keshav,

We appreciate your interest in Syncfusion products.

After setting the HeaderText for the columns, you can specify the GroupByOptions.CaptionText for that column setting the header text instead of the default caption (the default setting is:
.CaptionText = "{CategoryName}: {Category} - {RecordCount} Items";).

Here is some code:


this.gridGroupingControl1.TableDescriptor.Columns["Col1"].HeaderText = "MyColumn";
this.gridGroupingControl1.TableDescriptor.Columns["Col1"].GroupByOptions.CaptionText = "MyColumn : {Category} - {RecordCount} Items";


Another option is to replace it dynamically by handling GridGroupingControl.QueryCellStyleInfo, checking for e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell.


Regards,
Jisha


Loader.
Up arrow icon