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

setting Grouping title

Thread ID:

Created:

Updated:

Platform:

Replies:

31172 Jun 30,2005 08:38 PM UTC Jun 30,2005 10:58 PM UTC Windows Forms 1
loading
Tags: GridControl
Lan Mo
Asked On June 30, 2005 08:38 PM UTC

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

Administrator [Syncfusion]
Replied On June 30, 2005 10:58 PM UTC

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.

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

;