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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

custom captiontext

Thread ID:





11530 Mar 9,2004 03:22 PM UTC Mar 10,2004 05:01 PM UTC WinForms 9
Tags: Grouping
Administrator [Syncfusion]
Asked On March 9, 2004 03:22 PM UTC

Hi, I''m trying to change the group captiontext to show a couple other column values on that line. so far all i could do was concatenate the fields in the sql and group by that new column. I''m wondering if there is a better way? tia

Administrator [Syncfusion]
Replied On March 10, 2004 12:09 AM UTC

Colin, you can override the contents of any cell in the grouping grid by handling the GridGroupingControl.QueryCellStyleInfo event. Check for e.Style.TableCellIdentity.TableCellType == GridTableCellType.CaptionCell and then assign the text you want to display in the cell as e.Style.Text. Stefan

Administrator [Syncfusion]
Replied On March 10, 2004 11:35 AM UTC

ok, so now how do i retreive some data from a couple columns under each group to put in the caption? tia

Administrator [Syncfusion]
Replied On March 10, 2004 11:50 AM UTC

also, once i''m in the QueryCellStyleInfo event, can you see what the grouping field is?

Administrator [Syncfusion]
Replied On March 10, 2004 11:58 AM UTC

ok, i found e.style.tablecellidentity.groupedcolumn.name for that last question.

Administrator [Syncfusion]
Replied On March 10, 2004 12:06 PM UTC

hehe, the rowcount might be nice also. Cheers!

Administrator [Syncfusion]
Replied On March 10, 2004 12:17 PM UTC

i guess i can use e.style.text to get the recordcount right next to "items". is there another way?

Administrator [Syncfusion]
Replied On March 10, 2004 01:54 PM UTC

The style identity object has a DisplayElement property (which should be a CaptionRow element in your case). You can get the group that is displayed in that caption with the .ParentGroup property. This Group then offers a couple of methods, e.g. GetFilteredRecordCount() will return the number of records in that group. CategoryKeys returns the keys for this category and GetChildCount() returns "Items count" property. In the GroupCustomers sample you can hover the mouse over the cells and a tooltip will display the DisplayElement kind for various cells and some more information found in the style identity objects for cells. Stefan

Administrator [Syncfusion]
Replied On March 10, 2004 03:56 PM UTC

Here is a little sample showing some ways to do most of the things you mentioned. GGC_QueryCellStyleInfo_3768.zip

Administrator [Syncfusion]
Replied On March 10, 2004 05:01 PM UTC

Perfect! Thanks alot!


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon