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

FilterByValue (And) operator

5 Answers 35 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Barbaros Saglamtimur
Top achievements
Rank 1
Barbaros Saglamtimur asked on 30 Apr 2013, 12:40 PM
Hi,
I have a filter function like;
RadPivotGrid1.FilterByValue(PivotGridFilterFunction.IsGreaterThan, pivotGridField,
                            RadPivotGrid1.Fields.GetFieldByUniqueName("Butce") as PivotGridAggregateField, "0", true);
RadPivotGrid1.FilterByValue(PivotGridFilterFunction.IsGreaterThan, pivotGridField,
                            RadPivotGrid1.Fields.GetFieldByUniqueName("Fiili") as PivotGridAggregateField, "0", true);
I would like at add And operator so that filter runs as (Butce>0 and Fiili>0).
How can I achieve this.

TIA.

5 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 03 May 2013, 12:07 PM
Hello Barbaros,

The API does not supports to pass several fields and values to filter on one time. But you can use the last parameter of the function to suppress the rebind as you currently do.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Barbaros Saglamtimur
Top achievements
Rank 1
answered on 06 May 2013, 03:00 PM
Thanks for your reply, but I could not get what I would like to. If you see my attached screen shot, I would like to add filter to "Total Sum Of Planned" and "Total Sum Of Actual" fields, which both have "0" value (marked green). But when I apply filtering which I mentioned at my previous post, it applies filtering on "Total Sum Of Planned">0 and after then "Total Sum Of Actual" >0 (so OR operator) and filters red marked rows as-well. But I want to keep those lines. How can I achieve this?

TIA.
0
Vasil
Telerik team
answered on 08 May 2013, 11:44 AM
Hello Barbaros,

From the screen shot that you have shared, it seems that the filtering is not applied at all. It shows rows that have Planed and Actual both zeroes. So from what I am seeing this data are not filtered by any of these fields.
The first example that you have filters on both values in the same time, so this would mean that Butce>0 and Fiili>0.

Regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Barbaros Saglamtimur
Top achievements
Rank 1
answered on 15 May 2013, 06:46 AM
At the screen show, its shown non-filtered results.
When I apply
RadPivotGrid1.FilterByValue(PivotGridFilterFunction.IsGreaterThan, pivotGridField,
                            RadPivotGrid1.Fields.GetFieldByUniqueName("Planned") as PivotGridAggregateField, "0", true);
It removes (filters) lines 1, 6 (Green Boxes) and 4, 13, 18 (Red Boxes with Planned=0) which is normal.
After above filter I apply
RadPivotGrid1.FilterByValue(PivotGridFilterFunction.IsGreaterThan, pivotGridField,
                            RadPivotGrid1.Fields.GetFieldByUniqueName("Actual") as PivotGridAggregateField, "0", true);
It removes (filters) lines 1, 6 (Green Boxes) and 14, 19 (Red Boxes with Actual=0) which is normal.
But I would like to remove (filter) just Green Boxes (lines 1, 6), where condition is (Planned=0 and Actual=0)
0
Vasil
Telerik team
answered on 15 May 2013, 07:54 AM
Hi Barbaros,

When you filter it applies apply function like: "remove these items from the current collection that does does not fit the requirements" and it is working with AND condition.
For example:
You remove all the items for which Planned = 0
Then you remove all the items for which Actual = 0
So in the end only items with Planned>0 and Actual>0 stays.

The RadPivotGrid does not supports filtering to fit your requirements: to show only items with
(Planned>0 OR Actual>0)

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
PivotGrid
Asked by
Barbaros Saglamtimur
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Barbaros Saglamtimur
Top achievements
Rank 1
Share this question
or