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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Searching with Entity Framework

Thread ID:

Created:

Updated:

Platform:

Replies:

124380 Jun 6,2016 10:04 AM UTC Jun 7,2016 11:45 AM UTC ASP.NET MVC 2
loading
Tags: Grid
Arthur
Asked On June 6, 2016 10:04 AM UTC

Hello,

Iam using Grid with CRUDURL and loading Data with DataManager.
How to realize a dynamic search over all Columns?

Thanks

Arthur
Replied On June 6, 2016 10:20 AM UTC

If I use this as Datasource, searching is working:
.Datasource((IEnumerable<Mitarbeiter>)ViewBag.datasource2)

But I also want to Edit the Grid, so i changed it to:
.Datasource(ds=>ds.URL("Mitarbeiter/LoadData").CrudURL("Mitarbeiter/CrudUpdate").Adaptor(AdaptorType.UrlAdaptor)).AllowPaging()

Now i can not really search, because i have to pass dynamicly the search Columns to Entity Framework, what is not working.

Can I combine the Datasource Expression??? Like this:
.Datasource(ds=>ds.URL("Mitarbeiter/LoadData").CrudURL("Mitarbeiter/CrudUpdate").Adaptor(AdaptorType.UrlAdaptor)).AllowPaging().Datasource((IEnumerable<Mitarbeiter>)ViewBag.datasource2)

Thanks

Jayaprakash Kamaraj [Syncfusion]
Replied On June 7, 2016 11:45 AM UTC

Hi Arthur, 

Thank you for contacting Syncfusion support. 

While using UrlAdaptor, we need to handle grid operation(filtering/searching/sorting) in server side. Please refer to the below knowledgebase document, help document, code example and sample. 


GridFeatures.cshtml 
@(Html.EJ().Grid<object>("FlatGrid") 
            .Datasource(ds => ds.URL("/Grid/DataSource").CrudURL("/Grid/CrudUpdate").Adaptor(AdaptorType.UrlAdaptor)) 
        })) 
GridController.cs 
public ActionResult DataSource(DataManager dm) 
        { 
             
 
           if (dm.Search != null && dm.Search.Count > 0) //searching 
            { 
                result.result = operation.PerformSearching(DataSource, dm.Search); 
            } 
            .. 
 
           return Json(result, JsonRequestBehavior.AllowGet); 
        } 


Regards, 

Jayaprakash K. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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

;