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.
Unfortunately, activation email could not send to your email. Please try again.

Syntax for datasource URL handler

Thread ID:

Created:

Updated:

Platform:

Replies:

127992 Dec 22,2016 07:50 PM Dec 23,2016 06:04 AM ASP.NET Core 1
loading
Tags: Grid
R Brian Lindahl
Asked On December 22, 2016 07:50 PM

i have a grid with a datamanager like:

<e-datamanager url="/Customers/DataSource"
                 insert-url="/Customers/Insert"
                 remove-url="/Customers/Remove"
                 update-url="/Customers/Update"
                 adaptor="UrlAdaptor">

my handler in the controller is

public ActionResult DataSource(DataManager dm)

as it was in mvc5. However, although I can see the params being passed properly from the web page (skip: 0 and take: 12), the properties of the object passed to the DataSource method are 0, so no skip/take happens server-side.

I saw elsewhere that the insert-url et al. have a "CRUDModel<>" wrapper around the param type, which avoids a similar problem there... is there something similar needed for the DataManager?

Jayaprakash Kamaraj [Syncfusion]
Replied On December 23, 2016 06:04 AM

Hi Brian,   
  
Thank you for contacting Syncfusion support.   
  
For ASP.NET core sample, we can get the dynamic value using “[FromBody] ” as follows,    
 
<ej-grid id="GridContainer" 
.. 
" 
         allow-paging="true" 
         is-responsive="true" 
         enable-responsive-row="true"> 
    <e-datamanager url="/Home/DataSource" insert-url="/Home/CellEditInsert" update-url="/Home/CellEditUpdate" remove-url="/Home/CellEditDelete" adaptor="UrlAdaptor"></e-datamanager> 
    .. 
 
</ej-grid>  
HomeController.cs 
namespace WebApplication8.Controllers 
{ 
    public class HomeController : Controller 
    { 
        .. 
  public ActionResult DataSource([FromBody]DataManager dm) 
        { 
 
// do your operations here 
        } 
        public ActionResult CellEditUpdate([FromBody]CRUDModel<Orders> value) 
        { 
          // do your operations here 
        } 
        public ActionResult CellEditInsert([FromBody]CRUDModel<Orders> value) 
        { 
             // do your operations here  
        } 
        public ActionResult CellEditDelete([FromBody]CRUDModel<Orders> value) 
        { 
              // do your operations here 
        } 
    } 
} 



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.

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.

;