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

Trouble with the AggregateResultsList on Recalculate

5 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Reven
Top achievements
Rank 1
Reven asked on 23 Nov 2009, 12:46 PM

Hi. I just updated to the latest internal build for Silverlight RadGrid, since this release should have the bug with the UI not being updated on recalculation. This seems to work fine until I add a ResultFormatString to the SumFunction, then the display of the sum gets messed up. Can you confirm if this is a bug in the component? I have attached the code I use and a image of how it looks when messed up.

I also tried using a IValueConverter on the binding on the TextBlock, instead of the ResultFormatString, with the same result.

<telerikGridView:GridViewDataColumn Header="Value"   
                                    UniqueName="CurrentValue"   
                                    DataMemberBinding="{Binding CurrentValue, Converter={StaticResource currentPriceConverter}}"   
                                    IsSortable="False" 
                                    MinWidth="100" 
                                    Width="Auto" 
                                    TextAlignment="Right" 
                                    HeaderTextAlignment="Right">  
    <telerikGridView:GridViewDataColumn.AggregateFunctions> 
        <data:SumFunction SourceField="CurrentValue" ResultFormatString="{}{0:c}" /> 
    </telerikGridView:GridViewDataColumn.AggregateFunctions> 
    <telerikGridView:GridViewDataColumn.Footer> 
        <GridView:AggregateResultsList ItemsSource="{Binding}">  
            <ItemsControl.ItemTemplate> 
                <DataTemplate> 
                    <TextBlock VerticalAlignment="Top" Text="{Binding FormattedValue}" HorizontalAlignment="Right" FontWeight="Bold"/>  
                </DataTemplate> 
            </ItemsControl.ItemTemplate> 
        </GridView:AggregateResultsList> 
    </telerikGridView:GridViewDataColumn.Footer> 
</telerikGridView:GridViewDataColumn> 

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 26 Nov 2009, 07:55 AM
Hello,

I've just tried this using our latest build however everything worked fine - please check the attached project for reference.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Reven
Top achievements
Rank 1
answered on 30 Nov 2009, 09:54 AM
Hi, thanks for the answer.

I attached the project you provided and it worked fine, so I checked a bit further. It seems like it is the theme that is messing it up.

Are there any changes to the themes that can mess this up? I tried to rebuild the themes using the new builds of the controls, but the aggregates still gets messed up. When I added the theme that's following the latest build it's working fine. Is it possible to get the source for the themes if there are any changes to them? We need to change a few of the colors on one of the themes to use it.

Thanks in advance.
0
Kalin Milanov
Telerik team
answered on 03 Dec 2009, 09:51 AM
Hi Reven,

Currently we are not shipping the Themes sources with our internal builds which is something we are considering of doing in the future. That being said I cannot provide you with the xaml for that particular build. On the flip side we are finalizing a Q3 Service Pack 1 which will be available early next week.

A part from the many fixes it will include the themes for all our controls.

Sincerely yours,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
simona
Top achievements
Rank 1
answered on 27 May 2011, 09:31 AM
Hi, I am trying to create exactly this footer template but from c# code.
Unfortunately I do not understand what should be the ItemsSource for the binding of AggregateResultsList in C# code.
Mode precisely: I try to translate this in C#:   ItemsSource="{Binding}"

existing code behind:

           var gridColumn = this.GridView.Columns[3];
            var aggregateItems = new AggregateResultsList();
            var aggItemsSourceBinding = new Binding("ItemsSource")
                                            {
                                                Source = gridColumn
                                            };
            aggregateItems.SetBinding(ItemsControl.ItemsSourceProperty, aggItemsSourceBinding);
            aggregateItems.ItemTemplate = GridTotalsTemplate;

And item template is defined in Xaml:
 <DataTemplate x:Name="GridTotalsTemplate">
                            <TextBlock VerticalAlignment="Top"
                       Text="{Binding FormattedValue}" HorizontalAlignment="Right"/>
</DataTemplate>

Thank you
0
Vanya Pavlova
Telerik team
answered on 27 May 2011, 11:58 AM
Hello Reven,

 

Why not use the approach demonstrated in your online "Totals" demo?
If you want to change the footer template at runtime you may reference the defined DataTemplate within a UserControl's Resource Collection and then set it to this column dynamically. 


Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Reven
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Reven
Top achievements
Rank 1
Kalin Milanov
Telerik team
simona
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or