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

[Solved] Reset filter doesn't show complete collection

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bogice
Top achievements
Rank 1
Bogice asked on 02 Feb 2010, 06:39 PM
Hi Telerik,
I want to reset the filter in columns and i did like this, as show in some other posts. However when the grid rebind, it still show the filtered records, even though the collection attached to grid has full records. What am i doing wrong?
Thank you

protected void btnReset_Click(object sender, EventArgs e) 
    { 
        foreach (GridColumn column in grdContacts.MasterTableView.Columns) 
        { 
            column.CurrentFilterValue = string.Empty; 
        } 
        grdContacts.Rebind(); 
        
    } 

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 05 Feb 2010, 09:18 AM
Hello Bogice,

Your approach is correct, just add one extra line of code as follows:

foreach (GridColumn column in RadGrid1.MasterTableView.Columns)
{
    column.CurrentFilterValue = string.Empty;
    column.CurrentFilterFunction = GridKnownFunction.NoFilter;
}
RadGrid1.MasterTableView.FilterExpression = "";
RadGrid1.Rebind();

I hope this helps.

All the best,
Tsvetoslav
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
Bogice
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or