Hi,
I am trying to use the AggregateFunctions and display them inside the Footer of the Grid using ItemsControl.ItemTemplate similar to the sample you provide. Though this works fine I have run into a problem, I have a tab control with 2 tabs inside each tab I have a Grid both using AggregateFunctions displayed in the footer using the ItemsControl.ItemTemplate. Initially the footers are displayed fine, if I however move between tabs/grids the footers are displayed empty.
If I do not use the ItemsControl.ItemTemplate approach the footers work fine, if I go and add or update the contents of the grid then the footer is displayed correctly again.
This code does not work:
This code does display but I would really like to control how it is displayed:
I am using Q2 2009 (Version: 2009.2.701.35)
Hopefully it is something I am missing.
Regards,
Glen
I am trying to use the AggregateFunctions and display them inside the Footer of the Grid using ItemsControl.ItemTemplate similar to the sample you provide. Though this works fine I have run into a problem, I have a tab control with 2 tabs inside each tab I have a Grid both using AggregateFunctions displayed in the footer using the ItemsControl.ItemTemplate. Initially the footers are displayed fine, if I however move between tabs/grids the footers are displayed empty.
If I do not use the ItemsControl.ItemTemplate approach the footers work fine, if I go and add or update the contents of the grid then the footer is displayed correctly again.
This code does not work:
<telerik:GridViewDataColumn Header="Available Amount" UniqueName="Amount" DataMemberBinding="{Binding Amount}" > |
<telerik:GridViewDataColumn.AggregateFunctions> |
<telerik:SumFunction Caption="Sum: " ResultFormatString="{}{0:0}" SourceField="Amount" /> |
<telerik:AverageFunction Caption="Average: " ResultFormatString="{}{0:0}" SourceField="Amount" /> |
</telerik:GridViewDataColumn.AggregateFunctions> |
<telerik:GridViewDataColumn.Footer> |
<StackPanel Orientation="Vertical" Margin="5,0"> |
<telerik:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center" Grid.Column="4"> |
<ItemsControl.ItemTemplate> |
<DataTemplate> |
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
<TextBlock VerticalAlignment="Center" Text="{Binding Caption}" Width="100"/> |
<TextBlock VerticalAlignment="Center" Foreground="Blue" Text="{Binding FormattedValue}" /> |
</StackPanel> |
</DataTemplate> |
</ItemsControl.ItemTemplate> |
<ItemsControl.ItemsPanel> |
<ItemsPanelTemplate> |
<StackPanel Orientation="Vertical" /> |
</ItemsPanelTemplate> |
</ItemsControl.ItemsPanel> |
</telerik:AggregateResultsList> |
</StackPanel> |
</telerik:GridViewDataColumn.Footer> |
</telerik:GridViewDataColumn> |
This code does display but I would really like to control how it is displayed:
<telerik:GridViewDataColumn Header="Available Amount" UniqueName="Amount" DataMemberBinding="{Binding Amount}" > |
<telerik:GridViewDataColumn.AggregateFunctions> |
<telerik:SumFunction Caption="Sum: " ResultFormatString="{}{0:0}" SourceField="Amount" /> |
<telerik:AverageFunction Caption="Average: " ResultFormatString="{}{0:0}" SourceField="Amount" /> |
</telerik:GridViewDataColumn.AggregateFunctions> |
</telerik:GridViewDataColumn> |
I am using Q2 2009 (Version: 2009.2.701.35)
Hopefully it is something I am missing.
Regards,
Glen