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

RadGrid: Predefined GroupDescriptors does not show GridViewDataColumn AggregateFunctions in GroupFooter/Header

4 Answers 228 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Chris asked on 19 Nov 2009, 09:49 PM
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?


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(thisnew 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> 
 




4 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 20 Nov 2009, 02:38 PM
Hello Chris,

Please excuse us for the inconvenience caused.  I have analyzed the problems and most of them are being caused by a specific bug in the aggregates result list. We are already working on fixing the bug  .  The fix will be included in our very next service pack release  within two weeks. Additionally we are going to provide a way to exclude aggregates from being shown in the group header when needed.

Thank you for the detailed description! It was very helpful for us to identify the problem.  I have updated your Telerik points.


Regards,
Pavel Pavlov
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
Chris
Top achievements
Rank 2
answered on 22 Nov 2009, 10:02 PM
Thankyou.  We'll be looking forward to working with it.
0
Nick Wood
Top achievements
Rank 1
answered on 19 Feb 2010, 03:52 AM
Hello

I am in trial with version:

2009.3 1314


And the above problem still exists, can anyone please post an update on this issue and if there is a service pack or version with the fix as this feature will be crucial to our application.

nick
0
Pavel Pavlov
Telerik team
answered on 24 Feb 2010, 11:44 AM
Hello Nick Wood,

Plese download the latest internal build . It should be available in your Client.Net account .

I have tested with a small project to be sure everything is OK . Please find it attached.

Kind regards,
Pavel Pavlov
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
Chris
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Chris
Top achievements
Rank 2
Nick Wood
Top achievements
Rank 1
Share this question
or