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

Clear filters on my ASPX grid

2 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 05 Nov 2012, 08:02 AM
dear sirs,

I am new to telerik, and I am trying out your controls. I have enabled filters in my grid but I would like to add a button to clear all the filters. Is this possible and how can it be done?

Thanks
Thomas

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Nov 2012, 08:16 AM
Hi Thomas,

I guess you want to clear filter on an External button Click. Please take a look into the following code snippet.

C#:
protected void Button1_Click(object sender, EventArgs e)
{
    foreach (GridColumn column in RadGrid2.MasterTableView.Columns)
    {
        column.CurrentFilterFunction = GridKnownFunction.NoFilter;
        column.CurrentFilterValue = String.Empty;
    }
    RadGrid2.MasterTableView.FilterExpression = String.Empty;
    RadGrid2.Rebind();
}

Thanks,
Shinu.
0
Thomas
Top achievements
Rank 1
answered on 05 Nov 2012, 08:21 AM
Thanks I will try it. appreciate your help.

Impressed by the speed of response time.


Tags
Grid
Asked by
Thomas
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Thomas
Top achievements
Rank 1
Share this question
or