Grdi support of OData V4.01 and the "in" or "containedin" functionality?

1 Answer 23 Views
Grid
Jstemper
Top achievements
Rank 1
Iron
Jstemper asked on 08 Jun 2021, 10:35 PM | edited on 08 Jun 2021, 10:59 PM

Does the GridReadEventArgs support some sort of in functionality?

I am trying to programmatically use several multiselect lists to create the initial query for loading data into a grid via an OData datasource.

The "query" created is close but the fieldname is surrounded by single quotes so the query does not work

This is what is created

filter=(contains('abc,DEF','MyColName'))

but this is the proper syntax

filter=(contains('abc,DEF', MyColName))

Is there anyway short of manipulating the resulting query string to remove the single  quotes from around 'MyColName'?

Or IsContainedIn now supported in the latest version of the Blazor UI library?

1 Answer, 1 is accepted

Sort by
0
Nadezhda Tacheva
Telerik team
answered on 11 Jun 2021, 01:12 PM

Hi John,

You can manipulate the resulting query string from ToODataString() of the DataSourceRequest to achieve the desired scenario. For example:

var result = args.DataSourceRequest.ToODataString()
result = "$filter=(...)"

 

In terms of the IsContainedIn operator, it is generally available in Blazor, however, as "in" operator is not supported by earlier than OData v4.01, to be able to cover all possible scenarios (for example some applications might be using older versions), the IsContainedIn operator is currently translated to Contains.

I hope you will find the above information useful. If any further questions appear, please do not hesitate to contact us. Thank you for choosing Telerik UI for Blazor!

Regards,
Nadezhda Tacheva
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid
Asked by
Jstemper
Top achievements
Rank 1
Iron
Answers by
Nadezhda Tacheva
Telerik team
Share this question
or