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.
Regards,
Nisha.