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

Column filters

1 Answer 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Emil
Top achievements
Rank 1
Emil asked on 24 Aug 2016, 12:55 PM

I have a fully working grid that I can filter per. column , that is you can filter by each column with say "contains" text.

Im wondering if there is a way for me to initialize that with path variables. f.e.

 

http://localhost:54000/home/index?title=something&name=othername 

 

and then the filter in the title column would have its filter text = "something" and the column name would have the filter text = "othername" etc.

 

I have a few columns.

 

Any ideas on how to do this ?

I have a index action in home controller that can reiceive these filter strings, but I dont know how to "set" them in the grid.

I could possibly send them into the view in the viewbag.

 

Regards,

Emil

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 Aug 2016, 11:03 AM
Hello Emil,

Depending if the MVC wrappers are used or not, there are two possible approaches:

1) Using MVC wrappers- The Grid will automatically apply the state values if they are in the correct format. Please check the following thread in our forum:

http://www.telerik.com/forums/passing-default-filter-sort-and-group-values-to-a-grid-via-querystring-url-paramaters

2) Using the vanilla HTML/JS Kendo UI widgets - Check how to parse the query string parameters into filter rules (e.g. JavaScript objects). This can be done either on the server or on the client:

http://www.telerik.com/forums/filter-kendo-grid-from-query-string-parameters

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-filter

I hope this is helpful.

Regards,
Stefan
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Emil
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or