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

custom captiontext

Thread ID:

Created:

Updated:

Platform:

Replies:

11530 Mar 9,2004 10:22 AM Mar 10,2004 12:01 PM Windows Forms 9
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On March 9, 2004 10:22 AM

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 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

Administrator [Syncfusion]
Replied On 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

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

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

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

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

Administrator [Syncfusion]
Replied On March 10, 2004 07:06 AM

hehe, the rowcount might be nice also. Cheers!

Administrator [Syncfusion]
Replied On 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?

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

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

Perfect! Thanks alot!

CONFIRMATION

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.

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.

;