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
480
Grouped Row Count is reseting after refreshing the datasouce.
posted

In one of my Wingrids I have to reset the group's description and display it in a different format. Below I have attached a sample that will show the same issue.

To view the issue, please open the sample application.

1) Click the load button.
2) Group by Column #2 (Super Hero). After grouping, the "InitializeGroupByRow" method changes the description (display text for the group) little differently. You can notice one of the rows shows three as count.
3) Click refresh button again. Now you can notice the counts getting reset into "1".

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Oscar,

    I'm not sure exactly why the description is changing, but the code you have here will not work correctly in any case. You are setting the description based on values within the description. This is not a good idea at all, because this event could fire again for the same row and you would end up recursively building a string based on itself.

    For what you are trying to do here, it seems like you should be using the GroupByRowDescriptionMask property, rather than the InitializeGroupByRow event.


            private void ugDataGrid_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {  
                e.Layout.Override.GroupByRowDescriptionMask = "[caption] ([count] [count,items,item,items]) - [value]";
            }

     

Children