On a grid, is it possible to change the default filter method for a string type column? To me, "contains" makes more sense than "is equal", as it will be used more often.
We've tried to change it on the columnMenuInit event, but on the first attempt to filter, the DropDownList is reset to the "is equal" option.
12 Answers, 1 is accepted
You can change the order in which the filter operators are defined for string type. This will affect the default/first filter option in the menu. Here is an example for this: http://jsbin.com/ulerib/2/editRegards,
the Telerik team
Please check the example below:Kind Regards,
Basically this feature is not supported out-of-the-box and it will require custom solution. For example you can modify the Grid prototype options object - that way the grid will be initialized with different default options.
I have updated the jsbin provided by Nikolay by adding a default filter on the datasource :
It works as the filter is applied by default however the filter icon is not activated on the column..
Any idea of a workaround ?
If I exclude "IsEqualTo" then the grid filter options render in the order I specify. As soon as I put IsEqualTo back in again, it defaults and ignores whatever I specified.
This works as expected.
This defaults back to KendoUI defaults and ignores my code.
The reason for current behavior is that the Grid internally exports filter settings only if the collection of filters have different count than the default filters collection or at least one filter have different text. That why in current case I would suggest to simply add one empty space to the end of one of the messages as follows:
This forces us to set the message for each operator. But we are using kendo.messages.fr-FR.js
So now we have to set the proper french message for each operator in each grid... this is a major maintenance issue.
Is there any way doing this without override messages?