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
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
March 10, 2004 11:50 AM UTC
also, once i''m in the QueryCellStyleInfo event, can you see what the grouping field is?
AD
Administrator
Syncfusion Team
March 10, 2004 11:58 AM UTC
ok, i found e.style.tablecellidentity.groupedcolumn.name for that last question.
AD
Administrator
Syncfusion Team
March 10, 2004 12:06 PM UTC
hehe,
the rowcount might be nice also.
Cheers!
AD
Administrator
Syncfusion Team
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?
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
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
AD
Administrator
Syncfusion Team
March 10, 2004 05:01 PM UTC
Perfect! Thanks alot!