Because it was asked, and is implied in the question title: it is possible to group "together" and not hierarchically. It requires a change to the data model so that all the grouping columns are held together in a single object.
In the datasource, the model and grouping configuration might look like
data: [
{ name: "Pork", cat_group: { category: "Food", subcategory: "Meat" } },
{ name: "Pepper", cat_group: { category: "Food", subcategory: "Vegetables" } },
{ name: "Beef", cat_group: { category: "Food", subcategory: "Meat" } }
],
group: [
// group by "category" and "subcategory" together
{ field: "cat_group" },
]
UPDATE for MVC integration:
If this is being done with serialized objects in ASP.NET MVC using an AJAX datasource, note that the grouping object must have value semantics (overriding Equals
and implementing ==
/!=
) as well as implementing IComparable
.