This is a migrated thread and some comments may be shown as answers.

RadGridView AggreagateFunctions: CalculateAggregates

3 Answers 202 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhinav
Top achievements
Rank 1
Abhinav asked on 03 Oct 2017, 04:34 PM

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

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 06 Oct 2017, 08:41 AM
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.
0
Abhinav
Top achievements
Rank 1
answered on 10 Oct 2017, 09:00 PM

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.

0
Stefan
Telerik team
answered on 13 Oct 2017, 12:26 PM
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.
Tags
GridView
Asked by
Abhinav
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Abhinav
Top achievements
Rank 1
Share this question
or