The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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;
}
}
ADAdministrator Syncfusion Team 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.