RadGridView AggreagateFunctions: CalculateAggregates

4 posts, 0 answers
  1. Abhinav
    Abhinav avatar
    40 posts
    Member since:
    Jun 2016

    Posted 03 Oct Link to this post

    Hi Telerik,

    We are using RadGridView's -Column- AggregateFunction. We have disabled the Group Panel and Group Footer.

    We are binding to an ObservableCollection of objects which implement INotifyPropertyChanged.

    We have noticed that calling CalculateAggregates() updates the underlying values in the AggregatesResults collection after each call to CalculateAggregates(), however, the RadGridView's aggregate footer row in the UI will only ever update the values after the first call; subsequent calls will not update the value in the footer row.

    In other words, the underlying AggregateResults values are always updated when calling CalculateAggregates(), however, the results on the screen in the RadGridView's aggregate footer row will remain as only the first updated calculated aggregate values, and will ignore displaying any further updates to the underlying aggregate values.

    We have also called .Rebind() with the same effect.

    XAML:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding aDatum}" Header="Data" DataFormatString="{}{0:,##0;(#,##0);0}" IsReadOnly="True" FooterCellStyle="{StaticResource GridViewFooterCellStyle}" HeaderTextAlignment="Center">
                                <telerik:GridViewDataColumn.AggregateFunctions>
                                    <telerik:SumFunction ResultFormatString="{}{0:#,##0;(#,##0);0}"/>
                                </telerik:GridViewDataColumn.AggregateFunctions>
                            </telerik:GridViewDataColumn>

    Style:

                <Style TargetType="telerik:GridViewFooterCell" x:Key="GridViewFooterCellStyle">

                    <Setter Property="FontWeight" Value="Bold"/>
                </Style>

    Could you please give direction on this issue? Why does the aggregate only refresh the RadGridView's footer row the first time calling CalculateAggregates() and not on subsequent calls to this function?

     

    Kind regards

  2. Stefan
    Admin
    Stefan avatar
    773 posts

    Posted 06 Oct Link to this post

    Hi Abhinav,

    Thank you for the detailed description of your setup and issue you are experiencing.

    Unfortunately, I was not able to replicate the problem locally. Can you please review the sample application I prepared for my tests? As you can see, the aggregates of the column are updated each time the CalculateAgDoes it differ in any manner from the approach you are using? Would it also be possible for you to modify the application with the approach you are using and send it as an attachment in a new support ticket? I will gladly assist you further.

    Have a great weekend, Abhinav.

    Regards,
    Stefan X1
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Abhinav
    Abhinav avatar
    40 posts
    Member since:
    Jun 2016

    Posted 10 Oct in reply to Stefan Link to this post

    Hi Stefan,

    We are using Prism's InteractionRequest to popup a dialog with a RadGridView and aggregates in the column footer.

    We've managed to solve the issue by traversing the Visual Tree using VisualTreeHelper and updating the UI elements manually for now.

    When we have a chance, we will post a sample application.

    We will keep you posted if any issues with this resolution.

     

    Kind regards.

  4. Stefan
    Admin
    Stefan avatar
    773 posts

    Posted 13 Oct Link to this post

    Hello Abhinav,

    Thank you for the update.

    I am glad that you have managed to find a solution that meets your requirements. Nevertheless, I would also like to clarify, that you should avoid using such solutions for the visual elements participating in the virtualization mechanism of the control(rows and cells). More information on this matter can be found in the UI Virtualization topic.

    Do let me know in case additional assistance is needed.

    Have a great weekend, Abhinav.

    Regards,
    Stefan
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top