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

[Solved] Filtering Grid by only one column at the time

1 Answer 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 21 Mar 2013, 01:44 AM
I have a RadGrid with multiple GridBoundColumns. The way it works now is if I filter column A and want to filter column B, the grid shows the result of filter B over Filter A. I don't want each column to filter independently. Is that Possible? So if I filter Column B it would shows me the result base on the original grid, not based on the previous filtering. Thank you I hope my english was clear enouth to explain what I want. Thank you for your time.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Mar 2013, 05:26 AM
Hi,

Try the following code.
c#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.FilterCommandName)
        {
           foreach (GridColumn column in RadGrid1.MasterTableView.Columns)
        {
            column.CurrentFilterFunction = GridKnownFunction.NoFilter;
            column.CurrentFilterValue = string.Empty;
        }
        RadGrid1.MasterTableView.FilterExpression = string.Empty;
        RadGrid1.Rebind();
        }
}

Thanks,
Shinu
Tags
Grid
Asked by
Paulo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or