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

[Solved] How to expose current MVC Grid filter

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ron
Top achievements
Rank 1
Ron asked on 31 Jan 2012, 11:52 PM
In my latest project, I have created a new MVC page that has a grid and details within the grid.  

I have enabled filtering, paging, and sorting.  I have no problems with paging and sorting, but the filtering was new since most of my ASPX pages had a filter section, that would then re-bind the grid with a ajax callback.  So the grid itself had no idea of the filter criteria.  This worked great, but now we are in need to make the filtering more dynamic based on the user requirements, and I have been able to do so with the .Filterable() setting built-in with the MVC-grid.  However, I need to be able to show this filter criteria to the end user.  

I know that the user can click the filter icon for each column, but that would require the user to click on nearly every column to see if a filter is or is not applied to the column.  What I would like to do is pass a simple string or json object that I can reference in the "OnDataBound" client event.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 03 Feb 2012, 03:30 PM
Hello Russell,

 You could use client-side filter method for this purpose. It filters the contents of the grid based on a string expression. Please have in mind that JavaScript function is available only if filtering is enabled and if the Required JavaScript files are manually included, you need to make sure that telerik.grid.filtering.js has been included.
 
I hope this information helps.

Greetings,
Alexander Valchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or