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. Image for the cookie policy date
close icon

GGC : Grouping columns

I have a grid in which 2 of the columns are CategoryID and CategoryDesc. I want categorize based on categoryid but in the CaptionText I want to show the CategoryDesc. How can I do that? None of the captiontext tokens allow you to select text from another column.

6 Replies

ST stanleyj Syncfusion Team January 5, 2006 10:48 AM UTC

Hi Anupama, The text in caption cell can be changed handling the QueryCellStyleInfo handler. private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if(e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell) e.Style.Text = "My Text"; } Best regards, Stanley


AN Anupama January 10, 2006 06:49 AM UTC

Thanks Stanley! That worked.


AN Anupama January 12, 2006 05:34 AM UTC

How can I get the tokens to display programatically in the Caption Text? Specifically the {RecordCount} token. The documentation says this comes from the CaptionSection.ParentGroup.GetFilteredRecordCount() but CaptionSection is a member of which class in e.TableCellIdentity? (I need to write this piece of code in QueryCellStyleInfo event handler). >Hi Anupama, > >The text in caption cell can be changed handling the QueryCellStyleInfo handler. > > private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) > { > if(e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell) > e.Style.Text = "My Text"; > } > >Best regards, >Stanley


ST stanleyj Syncfusion Team January 12, 2006 12:58 PM UTC

Hi Anupama, Let me know if this will work for you. e.TableCellIdentity.DisplayElement.ParentGroup.GetFilteredRecordCount() Best regards, Stanley


ST stanleyj Syncfusion Team January 12, 2006 12:58 PM UTC

Hi Anupama, Let me know if this will work for you. e.TableCellIdentity.DisplayElement.ParentGroup.GetFilteredRecordCount() Best regards, Stanley


AN Anupama January 12, 2006 01:16 PM UTC

Yes! This works exactly the way its supposed to. Thanks! >Hi Anupama, > > >Let me know if this will work for you. > >e.TableCellIdentity.DisplayElement.ParentGroup.GetFilteredRecordCount() > >Best regards, >Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon