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

RadGrid : Clear filter on insertion

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Angella
Top achievements
Rank 1
Angella asked on 06 Nov 2012, 03:22 AM
Hi,

In my RadGrid, I've enabled filtering of columns. I need to clear the filter on inserting a new row. How can I do that?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Nov 2012, 03:23 AM
Hi,

Try the following approach to clear filter on inserting new row.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
     if (RadGrid1.MasterTableView.IsItemInserted)
     {
        foreach (GridColumn column in RadGrid1.MasterTableView.Columns)
        {
            column.CurrentFilterFunction = GridKnownFunction.NoFilter;
            column.CurrentFilterValue = string.Empty;
        }
        RadGrid1.MasterTableView.FilterExpression = string.Empty;
        RadGrid1.MasterTableView.Rebind();
     }
}

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