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

Filter in code behind

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Boylan
Top achievements
Rank 2
David Boylan asked on 21 Nov 2008, 11:45 AM
Hi

After performing a server side action (adding a new record to the database) I want to put that users details into the filter and refresh the grid so that users is displayed and selected.  I cant find a way of altering the filter text etc from the server side.  Some sort of client side solution would be acceptable but again I am struggling to find out how to do it.

Thanks for any help

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Nov 2008, 12:37 PM
Hello Geoff,

I believe the example shown in the following help article will be useful:
Applying default filter on initial load

protected void RadGrid1_PreRender(object sender, System.EventArgs e) 
 if (!Page.IsPostBack) 
 { 
   RadGrid1.MasterTableView.FilterExpression = "([Country] LIKE \'%Germany%\') "
   GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("Country"); 
   column.CurrentFilterFunction = GridKnownFunction.Contains; 
   column.CurrentFilterValue = "Germany"
   RadGrid1.MasterTableView.Rebind(); 
 } 
}  

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
David Boylan
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or