This question is locked. New answers and comments are not allowed.
Hi
In an asp.net mvc telerik grid, the default filter is "is equal to", is it possible to have instead by default another option? In my case I would like to have by default "contains", because it's the one we use 99% of time, and it's an operation we do often.
Thank you
In an asp.net mvc telerik grid, the default filter is "is equal to", is it possible to have instead by default another option? In my case I would like to have by default "contains", because it's the one we use 99% of time, and it's an operation we do often.
Thank you
7 Answers, 1 is accepted
0
Hello Julien,
You could easily achieve this with the following function hooked to the OnLoad event of the Grid.
I hope this helps.
Regards,
Petur Subev
the Telerik team
You could easily achieve this with the following function hooked to the OnLoad event of the Grid.
function onGridLoad(){ $('.t-grid-filter').one('click', function () { var container = $(this).data().filter; $('.t-filter-operator',container).val('substringof'); });} I hope this helps.
Regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Julien
Top achievements
Rank 1
answered on 11 Jul 2012, 09:44 AM
Exactly what I needed, thank you very much
0
Julien
Top achievements
Rank 1
answered on 20 Feb 2013, 10:45 AM
I just remarked a problem with this:
We have a non-ajax binding.
So if we do the following:
1. Open the filter by clicking on the filter icon
2. Change the selected filter type to another one
3. Type a value for the filter
4. Apply
5. -- The page reload --, the filter is correctly made
6. Click again on the filter icon
7. It's not the current filter type which is displayed, but the default one we set with the JS code
Any idea about how to make a workaround for this?
We have a non-ajax binding.
So if we do the following:
1. Open the filter by clicking on the filter icon
2. Change the selected filter type to another one
3. Type a value for the filter
4. Apply
5. -- The page reload --, the filter is correctly made
6. Click again on the filter icon
7. It's not the current filter type which is displayed, but the default one we set with the JS code
Any idea about how to make a workaround for this?
0
Julien
Top achievements
Rank 1
answered on 18 Mar 2013, 04:08 PM
It makes one month that we didn't get any answers, can you please respond?
0
Beat
Top achievements
Rank 1
answered on 18 Mar 2013, 05:09 PM
same problem for me
0
Hello,
The shared work-around is applicable only for Ajax bound Grid. When using server binding the whole page is reloaded and the selected filter will be changed by the code I shared. I am sorry but there is no simple work-around for the server binding scenario.
Kind Regards,
Petur Subev
the Telerik team
The shared work-around is applicable only for Ajax bound Grid. When using server binding the whole page is reloaded and the selected filter will be changed by the code I shared. I am sorry but there is no simple work-around for the server binding scenario.
Kind Regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Yves
Top achievements
Rank 1
answered on 14 May 2013, 08:46 AM
This code works for me:
Its sort of a hack but it does the job :)
function onGridLoad() { $('.t-grid-filter').one('click', function () { var container = $(this).data().filter; $('.t-filter-operator', container).each(function () { var value = $(this).next().val(); if (value === "") { $(this).val('substringof'); } }); });}Its sort of a hack but it does the job :)