Flexgrid column filter

Posted by: Ranba790 on 17 October 2018, 5:55 pm EST

    • Post Options:
    • Link

    Posted 17 October 2018, 5:55 pm EST

    Hi

    Using the column filter on multiple columns create an AND condition between the column. The row will show if all the filters conditions are true.

    Is there a way to create a multicolumn filter with an OR condition.

    For example a grid with 2 columns and values ranging from 1 to 100.

    I would like to show rows that are over 80 in any of the columns.

    Thanks

  • Posted 17 October 2018, 8:15 pm EST

    Hi,

    Column filters are used on a single column so it’s not possible to apply a filter which can check grid values from multiple columns.

    You would need to filter the values manually and hide the rows. Here’s an example:

    for (int row = _flex.Rows.Fixed; row < _flex.Rows.Count; ++row)
    {
        bool rowVisibility = false;
        foreach (int col in filterColIndices)
        {
            if (Convert.ToInt32(_flex[row, col]) > parameter)
            {
                rowVisibility = true;
                break;
            }
        }
        _flex.Rows[row].Visible = rowVisibility;
    }
    

    Please also find the attached sample where rows are filtered using OR condition.

    Regards,

    Jitender

    MultiColumnORFilter.zip

Need extra support?

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

Learn More

Forum Channels