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.
Syncfusion Feedback

Set Group By Header to show Combo Text not Value

Thread ID:

Created:

Updated:

Platform:

Replies:

103064 Mar 27,2012 09:32 PM UTC Apr 9,2012 01:18 PM UTC Windows Forms 5
loading
Tags: GridControl
Eric Robishaw
Asked On March 27, 2012 09:32 PM UTC

In a Data Bound Grouping Grid Control, if a user groups by a column that has a drop down list, the item displayed in the header of each group is the VALUE not the TEXT of the list items

Example: In a column named TreeTypes with combo boxes may have values:
Oak (1)
Pine (2)
Other (3)

If the user groups by that column, the Header will display something like:

Tree Types: 1 -- 2 items

That's not helpful for the user at-all... they don't know or care what the value for Oak (i.e,. 1) is...

What I want it to display is:
Tree Types: Oak -- 2 items





Mercy C [Syncfusion]
Replied On March 28, 2012 01:06 PM UTC

Hi Eric,

Thanks for your interest in Syncfusion products.

you can set the Group caption text, using "CaptionText" property.

this.gridGroupingControl1.ChildGroupOptions.CaptionText = "Total Records for {CategoryCaption}:{Category} is {RecordCount}";

Please refer to the sample in the following link
http://www.syncfusion.com/downloads/Support/DirectTrac/92661/WindowsFormsApplication73-96986498.zip

Regards,
Mercy.C


Eric Robishaw
Replied On March 28, 2012 04:04 PM UTC

Unfortunately, none of the customizable {} fields allow for the TEXT of the grouped by column, it still only shows the underlying VALUE.

See The attached. I modified your example to show the problem.

It now groups by "Department" instead of "Average". I set the Department column to be type ComboBox.

I want the GroupBy Header to Say something like:
"Grouped By Department 'Civil', Showing 6 Records"

Apparently there is no custom field {CategoryText} which is what I need.

I can't even seem to find a way to do this in the QueryCellStyleInfo event.








WindowsFormsApplication73 Group By Dept_108d5652.zip

Mercy C [Syncfusion]
Replied On April 5, 2012 10:39 AM UTC

Hi Eric,

Thanks for your interest in Syncfusion products.

You cannot directly set the caption text as required. To achieve your requirement, please set as "text" in the data table instead of "value".

dr[2] = deptNVP[rand.Next(deptNVP.Length-1)].Text;

Please refer to the sample in the following link

http://www.syncfusion.com/downloads/Support/DirectTrac/92937/WindowsFormsApplication73-1516279487.zip

please let me know if you have any concerns.

Regards,
Mercy.C



Eric Robishaw
Replied On April 6, 2012 04:21 PM UTC

Setting the field's value to the Text Value is NOT how relational databases work... and I'm actually displaying data from a DataTable (the example provided was a simplified way to show the problem, not a real world example).

Alas, I HAVE A WORKING SOLUTION

Create a custom IGroupByColumnCategorizer class ...
During the GroupedColumns_Changing event, set the column descriptor's Categorizer and Comparer to an instance of this class.

And viola....

SEE ATTACHED







WindowsFormsApplication73_f1976044.zip

Ragamathulla B [Syncfusion]
Replied On April 9, 2012 01:18 PM UTC

Hi Eric,

Thanks for the update.

We are glad to hear the issue has been resolved. Let me know if you have any further concerns.

Regards,
Ragamathullah B.


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.

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

;