We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to perform search operation using ODataV4Adaptor

Platform: ASP.NET MVC |
Control: Grid
Tags: grid

This knowledge base explains how to perform search operation using OdataV4 Adaptor.

Solution

In Web API 2.2 OData, $search query is not yet supported and hence it throws 404 exceptions while searching. To perform search operation using OdataV4 adaptor the custom adaptor can be used.

1.Render the Grid control.

HTML

 

JS

 

C#

 

MVC

 

C#

 

ASP

 

C#

 

2.In customAdaptor we have extended the OdataV4Adaptor and modified the search query to act as filter query.

In actionBegin event we have used contains operator for the string columns and equals operator for the number columns. So, we have assigned the search fields manually depending on the type of the column. In load event we have assigned the customAdaptor to the grid dataSource.

 

ANGULAR

HTML

 

TS

 

Result

Figure 1Initial Rendering of Grid

Figure 2After Searching in Grid

2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile