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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem grouping a CombobBox column

Thread ID:





78906 Jan 9,2009 03:41 PM UTC Jan 13,2009 12:41 PM UTC WinForms 4
Tags: GridControl
Asked On January 9, 2009 03:41 PM UTC


I'm using the GridGroupingControl version

The application I'm workin on uses several combobox columns which I want to group. The
comboboxes have their own datasource, so that in these columns the grid datasource only contains an ID and not an actual value. The text is displayed by the combobox.
This works well and grouping also works, but with one big problem: the grid shows the ID in the grouped row and not the value of the cell. Grouping becomes worthless because of this, because the ID is completly useless to the user.

I'm using the standard CaptionText: "{CategoryCaption} : {Category} - {RecordCount} Items"

Hopefully that was understandable and anybody can help me.

Nisha Arockiya A [Syncfusion]
Replied On January 12, 2009 01:02 PM UTC

Hi Fabian,

Thanks for your interest in Syncfusion Products.

I am afraid that I couldnot able to reproduce the issue here. Can you modify the attached sample to reproduce the issue so that we will work on it here for you? In the meantime, you can handle the TableControlCurrentCellCloseDropDown event to modify the value in the currentcell.


Please let me know if this helps.


Replied On January 12, 2009 02:18 PM UTC

OK, I modified the example. You simply have to group "Col2". The grouping row (the one with the +) will only show the numbers and not "value_1" etc.

I want to see the displaymember there and not the valuemember. I hope it's clear now what I'm talking about.


Nisha Arockiya A [Syncfusion]
Replied On January 13, 2009 10:41 AM UTC

Hi Fabian,

Thanks for the update.

The DisplayMember Value can be set in the Caption by handling the QueryCellStyleInfo event handler. In the QueryCellStyleInfo event handler check for the particular (ComboBox column) group name (the name of the column by which the group is categorized) and get the display member for the Category/value member from the table and set it in the e.Style.Text.

void sortGrouping_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
GridGroupingControl grid = sender as GridGroupingControl;
if (e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
Group group = e.TableCellIdentity.DisplayElement.ParentGroup;
if (group.Category != null && group.Name == "ID")//Check for the ComboBox(lookup) column

DataRow[] dr = dt.Select("Lookup_id = " + group.Category.ToString());
if (dr.GetLength(0) > 0)
string dispCat = dr[0]["Lookup_member"].ToString();
e.Style.Text = grid.TableDescriptor.Columns[group.Name].HeaderText + ": " + dispCat + " - " + group.GetFilteredRecordCount().ToString() + " Items.";
e.Handled = true;


Here is a sample.

Please let me know if this serve your needs.


Replied On January 13, 2009 12:41 PM UTC

Yes, that seems to work.

Thank you very much!


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