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

custom captiontext

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

9 Replies

AD Administrator Syncfusion Team March 9, 2004 07:09 PM

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


AD Administrator Syncfusion Team March 10, 2004 06:35 AM

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


AD Administrator Syncfusion Team March 10, 2004 06:50 AM

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


AD Administrator Syncfusion Team March 10, 2004 06:58 AM

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


AD Administrator Syncfusion Team March 10, 2004 07:06 AM

hehe, the rowcount might be nice also. Cheers!


AD Administrator Syncfusion Team March 10, 2004 07:17 AM

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


AD Administrator Syncfusion Team March 10, 2004 08:54 AM

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


AD Administrator Syncfusion Team March 10, 2004 10:56 AM

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


AD Administrator Syncfusion Team March 10, 2004 12:01 PM

Perfect! Thanks alot!

Loader.
Live Chat Icon For mobile
Up arrow icon