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. Image for the cookie policy date

setting Grouping title

Hello, I try using following code to set grouping title as description instead of code when a combobox column is grouped. I want to know the fieldname and field value that group is based on. How to get them? Thanks, private void gdBase_QueryCellStyleInfo(object sender,Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e) { if(e.Style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell) { GridCaptionRow capRow = e.Style.TableCellIdentity.DisplayElement as GridCaptionRow; Group g = capRow.ParentGroup; string sFieldName=g.Name; string sFieldValue="LOOKUP CODE"; //LOOKUP CODE string sFieldDesc="LOOKUP CODE''S DESCRIPTION"; //LOOKUP CODE''S DESCRIPTION e.Style.Text=sFieldDesc; } }

1 Reply

AD Administrator Syncfusion Team June 30, 2005 05:58 PM

The only thing readily available is the description that you can get from the group.Category. Group g = capRow.ParentGroup; string sFieldName = g.Name; Console.WriteLine("sFieldName= " + sFieldName); string sFieldDesc = g.Category.ToString(); Console.WriteLine("sFieldDesc= " + sFieldDesc); To get the field value that matches the g.Category which is the description, I think you would have to go directly to the lookup table, and find the record with the description value, and then get the other value you want from this record.

Live Chat Icon For mobile
Up arrow icon