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

RadGrid filter expression not working with ODataSource

3 Answers 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vikas
Top achievements
Rank 1
Vikas asked on 21 Jul 2014, 09:53 AM
Hi,

I've an implementation of RadGrid, source for which is OData.I am getting error when I apply the "Contains" filter. I found that the filter expression generated by the radgrid is not resolved by the OData and I get the following error.
The expression (([1].ColumnName1 = 1234) And IIF(([1].ColumnName2 = null), "", [1].ColumnName2).Contains("abc")) is not supported.

This issue started occurring after I updated the RadGrid dll from version 2012.1.215.35 to version 2014.2.618.35.

In the old version the filter expression used to be:
ColumnName1 = 1234 &&(ColumnName2.Contains("abc"))
Whereas with the new dll this expression is generated as:
ColumnName1 = 1234 && (iif(ColumnName2== null,"", ColumnName2).Contains("abc"))

Please help as soon as possible.

Thanks

3 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 23 Jul 2014, 12:12 PM
Hello Vikas,

The second expression seems correct. It checks if the ColumnName2 is not a null. Because if it is null, it will fail to execute Null.Contains().

Could you provide more information about your datasource and the configuration that you use.

Regards,
Vasil
Telerik
 

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.

 
0
Vikas
Top achievements
Rank 1
answered on 23 Jul 2014, 01:28 PM
Hi Vasil,

Thanks for your reply.
I've a linq query which I parse into the OData request and the results of this OData request are set as the data source for the grid. I use the filter expression generated by the grid table view as the where expression for my linq. Issue is that the IIF part of this expression is not supported in the OData request. I am trying to find out a way in which I can parse this IIF into the Odata request.

Thanks
Vikas
0
Vasil
Telerik team
answered on 28 Jul 2014, 01:52 PM
Hi Vikas,

If you use the internal binding of the grid directly to ODataSource or oData service it will work as in our demos, without need of additional coding.

If you want to parse the expressions manually, check out this blog:
http://weblogs.asp.net/scottgu/dynamic-linq-part-1-using-the-linq-dynamic-query-library


Regards,
Vasil
Telerik
 

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.

 
Tags
Grid
Asked by
Vikas
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Vikas
Top achievements
Rank 1
Share this question
or