Example of SQL being sent to SQL Server:
SELECT [Extent1].[ID] AS [ID], [Extent1].[Capture Date] AS [Capture Date], [Extent1].[Item Sequence Number] AS [Item Sequence Number],
FROM [dbo].[Images] AS [Extent1]
WHERE ((LOWER([Extent1].[Account Number])) = (LOWER('112233'))) OR ((LOWER([Extent1].[Account Number]) IS NULL) AND (LOWER('112233') IS NULL))
I am using hte latest version of Telerik UI for MVC and EF 6. The datasource code in the controller is:
public ActionResult Images_Read([DataSourceRequest]DataSourceRequest request)
Can I prevent Telerik's grid from using t-sql's lower function?
7 Answers, 1 is accepted
Currently there is no built-in way to disable this behavior. This is done in order to support case insensitive filtering in all possible LINQ providers. A possible workaround is to use custom binding and implement the filtering in your own code. The UI for ASP.NET MVC sample application includes a runnable demo which you can check.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
In order to make it case-sensitive you can use filterable ignoreCase option:
Telerik by Progress
with Kendo Grid version "2017.1.223" I have set IgnoreCase eg.: columns.Bound(c => c.CodResource).Title("CodResource").Filterable(filterable => filterable.IgnoreCase(true)).Width(180) but the sql that is sent to SQL server still use the "lower" function:
SQL Statement is:
where lower(v_resource0_.CodResource) like ('bb'+'%')
Any advice about avoid use of lower(..) function in WHERE Clause which causes performance issue?
If this is the SQL query generated by the Kendo UI methods, it is the built-in behavior as this is the part of the query which is making a case-insensitive search.
As my colleague, Atanas said in the first post, the option to modify this is to actually make custom filtering logic and the build the query programmatically without the built-in methods.
Apologies for the inconvenience this may have caused you.
could you give me an example about filtering (not only about sorting or paging like here: https://docs.telerik.com/aspnet-mvc/helpers/grid/binding/custom-binding#custom-ajax-binding)
Thanks in advance.
You probably have already seen this from my reply in your ticket but in case anyone else is looking for the same information, this demo shows an implementation that applies data operations manually, including filtering.