Is it possible to modify the filter so that it also displays a unique list of values for that column which you can filter by?
I'm looking for something similar to the Excel-like filtering in the Telerik WPF grid.
Thanks.
5 Answers, 1 is accepted
This is currently not possible. While the filtering menu can be customized the grid filtering engine does not support filtering by value in a range of chosen values which is a mandatory requirement.
Regards,Atanas Korchev
the Telerik team
If we want to implement our own filter menu completely, what would be the best approach to doing so? We want to implement it so that there will be checklist tree filter that will 'or' all the selected filters. Then 'and' it with the two textbox filters to create the final filter expression. Currently this is not supported in the control as the two textbox filters are just 'anded' together to create the filter expression.
The filters are in the form '(columnMember)~(operator)~(value)~and~(columnMember)~(operator)~(value)'
We want it so that the checklist filters are :
'(columnMember)~eq~(value)~or~(columnMember)~eq~(value)'
before anding them with the current two textbox filters to create filter expressions like:
(columnMember)~eq~(value)~or~(columnMember)~eq~(value)~and~(columnMember)~(operator)~(value)~and~(columnMember)~(operator)~(value)'
Also, are we allowed to modify the telerik.grid.filtering.js file?
Thanks.
The requirement which you describe would require entirely custom filtering UI (not part of the built-in menu which supports only single field filtering). Indeed you can construct a custom filter expression and pass it to the filter method. Still if you need the filtering UI to be part of the menu you can check this code library project for a working implementation.
You are allowed to modify telerik.grid.filtering.js as you see fit. We however do not support any modifications to the source code.
Atanas Korchev
the Telerik team
In order to create the filter expressions I require the column members. How would you access the column objects from a view. Currently I can get the Html element for the Grid by calling $( grid ID) but I don't know how to get the Grid object which contains the column objects.
Thanks.
You can get the grid client-side object like this:
var grid = $("#Grid").data("tGrid");The grid has an array of columns:
var columns = grid.columns;A column contains the column configuration. There is a member field which contains the member name:
var member = columns[0].member;Regards, Atanas Korchev
the Telerik team