Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
intercept grouping event to force a different grouping
posted

Hello --

I have a xamdatagrid and allowing the user to group on any column. One column, "type" is what I want displayed when they group on that column, but I want to it to be grouped by using a different value, typeID. So... user drags "Type" column to group by area, users sees "Type" groupings (while behind the scenes it actually grouped on TypeId. Yes, I expect the same "Type" to be listed more than once.

 This does not seem to work:

Grid_Grouping(object sender, GroupingEventArgs e) {

int index = e.Groups.ToList().FindIndex(x => x.FieldName == "Type");

if (index != 1) e.Groups[index] = new FieldSortDescription("TypeID", Ascending, true); } }