Programatically add value filter to column

Posted by: lea49117 on 27 September 2017, 8:27 pm EST

    • Post Options:
    • Link

    Posted 27 September 2017, 8:27 pm EST

    Hello,

    how do you programatically add a ValueFilter to a column?

    the documentation only shows conditional filter

    cheers,

  • Posted 27 September 2017, 8:27 pm EST

    Hello,

    Adding a Value Filter is very easy. Refer to the following snippet to implement it to a column:

    [csharp]

    col.AllowFiltering = AllowFiltering.ByValue;

    // initialize "ShipRegion" column filter to show only two values: "AK" and "CA"

    var col = _flex.Cols["ShipRegion"];

    var vf = col.Filter as ValueFilter;

    vf.ShowValues = new object { "AK", "CA" };

    // apply both column filters to the data

    _flex.ApplyFilters();

    [/csharp]

    Please refer to this code sample as well.

    Thanks.

  • Posted 20 November 2017, 5:44 pm EST

    Hi pragatikaushik

    Can we do this in Angular 1.x as well ? any sample

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels