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

Parents
  • 138253
    Verified Answer
    Offline posted

    Hello Daniel,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the fucntionality you want. Basically I used custom GroupByEvaluator where the grouping of City Field is based on Princode Field. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

    CustomGroupBy.zip
Reply Children