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

PivotGrid filtering not working

1 Answer 50 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Hayley
Top achievements
Rank 1
Hayley asked on 15 Oct 2015, 06:24 AM

When we try and filter on a field in our PivotGrid it does not show any labels in the items list (just the "Select All" option). Additionally if we try and apply a specific label filter (eg. "Contains") it does not return any data even though such data does exists.

Also, is there a way to apply a filter before you perform a layout update? Our cube is quite large so updating the layout without first applying a filter often causes timeouts.

 Thanks!

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 19 Oct 2015, 10:56 AM
Hi Hayley,

I tested the online demo below and was not able to isolate the problematic behavior on my end.
http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/olap/defaultcs.aspx

Test it on your end and verify if it helps.

As for the second question possible approach in your case is to apply initial filter by using the FilterByLabel and FilterByValue methods of the RadPivotGrid in the PreRender event.

For example:

FilterBylabel:

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByLabel(PivotGridFilterFunction.Contains, RadPivotGrid1.Fields["Cost"], "filter value");
}

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByLabel(PivotGridFilterFunction.IsNotBetween, RadPivotGrid1.Fields["Cost"], "filter value", "beetween filter value");
}

FilterByValue:

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByValue(PivotGridFilterFunction.BeginsWith,
        RadPivotGrid1.Fields["Line"],
        RadPivotGrid1.Fields["Total"] as PivotGridAggregateField,
        "filter value");
}

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    RadPivotGrid1.FilterByValue(PivotGridFilterFunction.IsBetween,
        RadPivotGrid1.Fields["Line"],
        RadPivotGrid1.Fields["Total"] as PivotGridAggregateField,
        "filter value",
        "between filter value");
}


Regards,
Maria Ilieva
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
PivotGrid
Asked by
Hayley
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or