Completed
Last Updated: 09 May 2016 13:59 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 03 May 2016 11:39
Category: PivotGrid
Type: Bug Report
0
FIX. RadPivotGrid - Top10FilterOptionsDialog throws NullReferenceException when no aggregates are available
To reproduce:

this.ordersTableAdapter.Fill(this.nwindDataSet.Orders);
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() 
{ PropertyName = "OrderDate", Step = DateTimeStep.Year, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() 
{ PropertyName = "OrderDate", Step = DateTimeStep.Quarter, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.RowGroupDescriptions.Add(new DateTimeGroupDescription() 
{ PropertyName = "OrderDate", Step = DateTimeStep.Month, GroupComparer = new GroupNameComparer() });
this.radPivotGrid1.ColumnGroupDescriptions.Add(new PropertyGroupDescription() 
{ PropertyName = "EmployeeID", GroupComparer = new GrandTotalComparer() });
this.radPivotGrid1.FilterDescriptions.Add(new PropertyFilterDescription() 
{ PropertyName = "ShipCountry", CustomName = "Country" });
this.radPivotGrid1.DataSource = this.ordersBindingSource;


Workaround:

public Form1()
{
    InitializeComponent();

    this.radPivotGrid1.DialogsFactory = new MyDialogsFactory();
    this.radPivotFieldList1.DialogsFactory = new MyDialogsFactory();
}

public class MyDialogsFactory : PivotGridDialogsFactory
{
    public override ITop10FilterOptionsDialog CreateTop10FilterOptionsDialog()
    {
        return new MyITop10FilterOptionsDialog();
    } 
}

public class MyITop10FilterOptionsDialog : Top10FilterOptionsDialog 
{
    public override ITopGroupsFilter SelectedFilter
    {
        get
        {
            if (((RadDropDownList)this.Controls["groupBox"].Controls["dropDownFields"]).SelectedValue == null)
            {
                return null;
            }
            return base.SelectedFilter;
        }
    }
}
Attached Files:
0 comments