RadControls for WPF Q3 2009.
I have predefined GroupDescriptors in XAML on the RadGrid, to show a Particular Group at start.
However the AggregateFunctions do not show up on the Group Footers or Headers. The Group Footers also look broken, as some grid lines are missing.
In the UI, if a user removes the prefined GroupDescriptor, and creates a new group through the UI with the same Column, the AggregateFunctions do show up.
I have also attempted to do this through C#, and get the same results.
Is there a particular way of predefining the GroupDescriptors so the Column's AggregateFunctions show up in the Group Footer?
Additional question. Is there way of defining a Column AggregateFunction to only appear in the GroupFooter, and not the header without writing a new ControlTemplate for the GridViewGroupRow?
I have predefined GroupDescriptors in XAML on the RadGrid, to show a Particular Group at start.
However the AggregateFunctions do not show up on the Group Footers or Headers. The Group Footers also look broken, as some grid lines are missing.
In the UI, if a user removes the prefined GroupDescriptor, and creates a new group through the UI with the same Column, the AggregateFunctions do show up.
I have also attempted to do this through C#, and get the same results.
Is there a particular way of predefining the GroupDescriptors so the Column's AggregateFunctions show up in the Group Footer?
Additional question. Is there way of defining a Column AggregateFunction to only appear in the GroupFooter, and not the header without writing a new ControlTemplate for the GridViewGroupRow?
public class Receipt : INotifyPropertyChanged |
{ |
#region fields |
string _source; |
double _amount; |
double _associatedAmount; |
double _allocatedAmount; |
double _availableAmount; |
DateTime _receiptEffectiveDate; |
string _receiptApplication; |
#endregion |
#region ctor |
public Receipt() |
{ |
} |
public Receipt(string source, double amount, double associatedAmount, double allocatedAmount, double availableAmount, DateTime receiptEffectiveDate, string receiptApplication) |
{ |
Source = source; |
Amount = amount; |
AssociatedAmount = associatedAmount; |
AllocatedAmount = allocatedAmount; |
AvailableAmount = AvailableAmount; |
ReceiptEffectiveDate = receiptEffectiveDate; |
ReceiptApplication = receiptApplication; |
} |
#endregion |
#region properties |
public string Source |
{ |
get { return _source; } |
set |
{ |
_source = value; |
NotifyPropertyChanged("Source"); |
} |
} |
public double Amount |
{ |
get { return _amount; } |
set |
{ |
_amount = value; |
NotifyPropertyChanged("Amount"); |
} |
} |
public double AssociatedAmount |
{ |
get { return _associatedAmount; } |
set |
{ |
_associatedAmount = value; |
NotifyPropertyChanged("AssociatedAmount"); |
} |
} |
public double AllocatedAmount |
{ |
get { return _allocatedAmount; } |
set |
{ |
_allocatedAmount = value; |
NotifyPropertyChanged("AllocatedAmount"); |
} |
} |
public double AvailableAmount |
{ |
get { return _availableAmount; } |
set |
{ |
_availableAmount = value; |
NotifyPropertyChanged("AvailableAmount"); |
} |
} |
public DateTime ReceiptEffectiveDate |
{ |
get { return _receiptEffectiveDate; } |
set |
{ |
_receiptEffectiveDate = value; |
NotifyPropertyChanged("ReceiptEffectiveDate"); |
} |
} |
public string ReceiptApplication |
{ |
get { return _receiptApplication; } |
set |
{ |
_receiptApplication = value; |
NotifyPropertyChanged("ReceiptApplication"); |
} |
} |
#endregion |
#region Interface INotifyPropertyChanged |
public event PropertyChangedEventHandler PropertyChanged; |
private void NotifyPropertyChanged(string propertyName) |
{ |
if (PropertyChanged != null) |
PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
} |
#endregion |
} |
public Window2() |
{ |
InitializeComponent(); |
ObservableCollection<Receipt> list2 = new ObservableCollection<Receipt>(); |
list2.Add(new Receipt("HELLO", 1123, 456, 1, 8, DateTime.Today, "B")); |
list2.Add(new Receipt("HELLO", 2123, 456, 2, 7, DateTime.Today, "B")); |
list2.Add(new Receipt("HELLO", 3123, 456, 3, 6, DateTime.Today, "C")); |
list2.Add(new Receipt("HELLO", 4123, 456, 4, 5, DateTime.Today, "C")); |
list2.Add(new Receipt("WORLD", 1123, 456, 5, 4, DateTime.Today, "A")); |
list2.Add(new Receipt("WORLD", 2123, 456, 6, 3, DateTime.Today, "B")); |
list2.Add(new Receipt("WORLD", 3123, 456, 7, 2, DateTime.Today, "C")); |
list2.Add(new Receipt("WORLD", 4123, 456, 8, 1, DateTime.Today, "D")); |
Binding binding = new Binding(); |
binding.Source = list2; |
uxRadGridView.SetBinding(RadGridView.ItemsSourceProperty, binding); |
} |
<telerik:RadGridView xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
AutoGenerateColumns="False" |
CanUserFreezeColumns="False" |
CanUserSortColumns="True" |
CanUserInsertRows="True" |
ShowGroupPanel="True" |
ShowColumnFooters="True" |
ShowGroupFooters="True" |
AutoExpandGroups="True" |
Grid.Row="1" x:Name="uxRadGridView" UseAlternateRowStyle="False" telerik:StyleManager.Theme="Office_Black"> |
<telerik:RadGridView.GroupDescriptors> |
<telerik:GroupDescriptor Member="Amount" /> |
</telerik:RadGridView.GroupDescriptors> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding Source}" /> |
<telerik:GridViewDataColumn IsFilterable="False" DataMemberBinding="{Binding Amount}" /> |
<telerik:GridViewDataColumn IsFilterable="False" Header="Associated Amount" DataMemberBinding="{Binding AssociatedAmount}" |
DataFormatString="{}{0:c}" TextAlignment="Right" HeaderTextAlignment="Right" FooterTextAlignment="Right" > |
<telerik:GridViewDataColumn.AggregateFunctions> |
<telerik:SumFunction ResultFormatString="{}{0:c}" SourceField="AssociatedAmount" /> |
</telerik:GridViewDataColumn.AggregateFunctions> |
</telerik:GridViewDataColumn> |
<telerik:GridViewDataColumn IsFilterable="False" Header="Allocated Amount" DataMemberBinding="{Binding AllocatedAmount}" |
DataFormatString="{}{0:c}" TextAlignment="Right" HeaderTextAlignment="Right" FooterTextAlignment="Right" > |
<telerik:GridViewDataColumn.AggregateFunctions> |
<telerik:SumFunction ResultFormatString="{}{0:c}" SourceField="AllocatedAmount" /> |
</telerik:GridViewDataColumn.AggregateFunctions> |
</telerik:GridViewDataColumn> |
<telerik:GridViewDataColumn IsFilterable="False" Header="Available Amount" DataMemberBinding="{Binding AvailableAmount}" |
DataFormatString="{}{0:c}" TextAlignment="Right" HeaderTextAlignment="Right" FooterTextAlignment="Right" > |
<telerik:GridViewDataColumn.AggregateFunctions> |
<telerik:SumFunction ResultFormatString="{}{0:c}" SourceField="AvailableAmount" /> |
</telerik:GridViewDataColumn.AggregateFunctions> |
</telerik:GridViewDataColumn> |
<telerik:GridViewDataColumn IsFilterable="False" Header="Receipt Effective Date" DataMemberBinding="{Binding ReceiptEffectiveDate}" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |