FilterByValue (And) operator

6 posts, 0 answers
  1. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 30 Apr 2013 Link to this post

    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.

  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 03 May 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 06 May 2013 Link to this post

    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.
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 08 May 2013 Link to this post

    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.
  6. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 15 May 2013 Link to this post

    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)
  7. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 15 May 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017