users group of subgroup number
Attachment: screen_example_13c68430.zip
Thank you for your interest in Syncfusion products.
We have analyzed your reported scenario. Our Syncfusion GridGroupingControl has support to customize grouping using IComparer and SortColumnDescriptor. Please refer the below provided code snippet and sample for further clarification. In this sample we have grouped the columns based a column value(similar to the image provided by you).
Code snippet:
//group "Col2" using a custom categorizer and Comparer
Syncfusion.Grouping.SortColumnDescriptor cd = new Syncfusion.Grouping.SortColumnDescriptor("Col2");
cd.Categorizer = new CustomCategorizer();
cd.Comparer = new CustomComparer();
this.gridGroupingControl1.TableDescriptor.GroupedColumns.Add(cd);
//defines a group and returns a group category object (here returns 1 through 5)
public static int GetCategory(string i)
{
int ret = 0;
if (i == "Group0")
{
ret = 1;
}
else if (i == "Group1")
{
ret = 2;
}
else
ret = 3;
return ret;
}
#region IGroupByColumnCategorizer Members
public object GetGroupByCategoryKey(SortColumnDescriptor column, bool isForeignKey, Record record)
{
return GetCategory(record.GetValue(column).ToString());
}
public int CompareCategoryKey(SortColumnDescriptor column, bool isForeignKey, object category, Record record)
{
return GetCategory(record.GetValue(column).ToString()) - (int)category;
}
Sample:
http://www.syncfusion.com/downloads/support/forum/119155/CustomGrouping-CS1667817960.zip
Please refer the below KB for reference. This is similar to you query. In this KB also column based custom grouping is done.
KB:
http://www.syncfusion.com/kb/498/how-to-do-custom-grouping-in-gridgroupingcontrol
Please let us know if you have any other concerns.
Thanks & Regards,
AL.Solai.
Hi Svyatoslav,
Thank you for your interest in Syncfusion products.We have analyzed your reported scenario. Our Syncfusion GridGroupingControl has support to customize grouping using IComparer and SortColumnDescriptor. Please refer the below provided code snippet and sample for further clarification. In this sample we have grouped the columns based a column value(similar to the image provided by you).
Code snippet://group "Col2" using a custom categorizer and Comparer
Syncfusion.Grouping.SortColumnDescriptor cd = new Syncfusion.Grouping.SortColumnDescriptor("Col2");
cd.Categorizer = new CustomCategorizer();
cd.Comparer = new CustomComparer();
this.gridGroupingControl1.TableDescriptor.GroupedColumns.Add(cd);
//defines a group and returns a group category object (here returns 1 through 5)
public static int GetCategory(string i)
{
int ret = 0;
if (i == "Group0")
{
ret = 1;
}
else if (i == "Group1")
{
ret = 2;
}
else
ret = 3;
return ret;
}
#region IGroupByColumnCategorizer Members
public object GetGroupByCategoryKey(SortColumnDescriptor column, bool isForeignKey, Record record)
{
return GetCategory(record.GetValue(column).ToString());
}
public int CompareCategoryKey(SortColumnDescriptor column, bool isForeignKey, object category, Record record)
{
return GetCategory(record.GetValue(column).ToString()) - (int)category;
}
Sample:
http://www.syncfusion.com/downloads/support/forum/119155/CustomGrouping-CS1667817960.zip
Please refer the below KB for reference. This is similar to you query. In this KB also column based custom grouping is done.
KB:
http://www.syncfusion.com/kb/498/how-to-do-custom-grouping-in-gridgroupingcontrol
Please let us know if you have any other concerns.
Thanks & Regards,
AL.Solai.
GetCategory() method is a grouping of the contest, but my data can be of different types and must be sorted in a standard way. The essence of my question: how to unite groups with one element of the same group?
Thank you for your update.
We have prepared a sample as per your requirement. For thisGrouping based on IComparer is not required. We can achieve this by performing a grouping based on adjacent column value in QueryValue event. Please refer the below provided sample and let us know if you have any other concerns.
Sample:
http://www.syncfusion.com/downloads/support/forum/119155/WindowsFormsApplication21_(4)-1651798363.zip
Please let us know if you have any other concerns.
Thanks & Regards,
Al.Solai
- 3 Replies
- 2 Participants
-
SR Svyatoslav Razmyslov
- May 15, 2015 06:30 AM UTC
- May 20, 2015 01:42 AM UTC