We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to group rows by default on initial load

Thread ID:





68812 Oct 2,2007 11:15 AM UTC Oct 4,2007 08:24 PM UTC WinForms 3
Tags: GridControl
Titus Cheung
Asked On October 2, 2007 11:15 AM UTC


Is there a way to set by default that whenever the Grid Group control loads rows of data from the dB, it'd automatically group them by a specific column?

For example an example here
illustrates that user can drag and drop the column name into the GroupDropArea in order to group the rows by that column. But I want this to be done on initial page load without requiring the user to do this.


haneefm [Syncfusion]
Replied On October 2, 2007 05:41 PM UTC

Hi Titus,

At Loadtime, you can programatically group the grid by adding the column to the TableDescriptor.GroupedColumns collection.

grid.TableDescriptor.GroupedColumns.Add("Col1"); //group by the column whose name is "Col1".

Best regards,

Titus Cheung
Replied On October 4, 2007 02:10 PM UTC


Thanks for the info.
Now that it's grouping on initial load, how do I set it such that it'd display a unique group name? For example, I'm sorting by a contactType column. This column has values "consultant", "engineer", "accountant", etc.

I found the section of code that does this and currently it has:
this.gridGroupingControl1.ChildGroupOptions.CaptionText = "{CategoryCaption}: {Category} - {RecordCount} Items";

and I need to change it to something like...
this.gridGroupingControl1.ChildGroupOptions.CaptionText = "{cellData}: {Category} - {RecordCount} Items";


haneefm [Syncfusion]
Replied On October 4, 2007 08:24 PM UTC

Hi Titus,

How can i change text of grid caption?
The Group CaptionText can be customized using the TableDescriptor.ChildGroupOptions.CaptionText property (gridGroupingGrid.TableDescriptor.ChildGroupOptions.CaptionText = "{CategoryName}: {Category}";).

If you want to append the celldata in a gridcaptioncell, then handle QueryCellStyleInfo event to have your own text, there check for the e.TableCellIdentity.TableCellType to be GroupCaptionCell and set the text. Kindly refer to the forum thread below for more details.


Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon