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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Crud Syntax in Asp.net Core(Controller)

Thread ID:

Created:

Updated:

Platform:

Replies:

129711 Mar 29,2017 08:12 PM UTC Apr 4,2017 01:18 PM UTC ASP.NET Core 3
loading
Tags: Grid
Hassan
Asked On March 29, 2017 08:12 PM UTC

Hi
I'm having a Problem in CRUD Syntax(IN ASP .NETCORE)         (The MVC Syntax NOT WORKING IN ASP.NETCORE)

Syntax Code available for ASP.NETCore does not work.

I need SAMPLE Syntax Code(Controller and Model) ASP.NET Core  For : BatchUpdate and CellEditUpdate and CellEditInsert and CellEditDelete and ...

Please help me to solve the problem.

Thanks.




 

Venkatesh Ayothi Raman [Syncfusion]
Replied On March 30, 2017 12:12 PM UTC

Hi Hassan, 
Thanks for contacting Syncfusion support. 

We have prepared a sample based on your requirement which can be download from following link, 

In that sample, we rendered the Grid with CRUD operation and define the CRUD methods in server side. Please refer to the following code example, 
Code example
@Grid 
<ej-grid id="FlatGrid" allow-paging="true" allow-filtering="true" allow-selection="true" > 
         
    <e-edit-settings allow-adding="true" allow-deleting="true" allow-editing="true"  ></e-edit-settings> 
    <e-toolbar-settings show-toolbar="true"  toolbar-items="@(new List<string>() { "add", "edit", "delete", "cancel", "update"})"></e-toolbar-settings> 
     
    <e-datamanager url="/Home/DataSource" insert-url="/Home/CellEditInsert" update-url="/Home/CellEditUpdate" remove-url="/Home/CellEditDelete" adaptor="UrlAdaptor"></e-datamanager> 
    <e-columns> 
. . . 
          
    </e-columns> 
</ej-grid> 
 
@server side code 
//Update the data 
        public ActionResult CellEditUpdate([FromBody]CRUDModel<Orders> value) 
        { 
            var ord = value.Value; 
            Orders val = order.Where(or => or.OrderID == ord.OrderID).FirstOrDefault(); 
            val.OrderID = ord.OrderID; 
            val.EmployeeID = ord.EmployeeID; 
            val.CustomerID = ord.CustomerID; 
            val.Freight = ord.Freight; 
            val.OrderDate = ord.OrderDate; 
            val.ShipCity = ord.ShipCity; 
 
            return Json(value.Value); 
        } 
        //insert the record 
        public ActionResult CellEditInsert([FromBody]CRUDModel<Orders> value) 
        { 
             
            order.Insert(0, value.Value); 
            return Json(value); 
        } 
        //Delete the record 
        public ActionResult CellEditDelete([FromBody]CRUDModel<Orders> value) 
        { 
            order.Remove(order.Where(or => or.OrderID == int.Parse(value.Key.ToString())).FirstOrDefault()); 
            return Json(value); 
        } 

If we set editmode as batch then batch url and server side code should be like as follows, 
@GRID 
<ej-grid id="FlatGrid" allow-paging="true" allow-filtering="true" allow-selection="true" > 
         
    <e-edit-settings allow-adding="true" allow-deleting="true" allow-editing="true"  edit-mode="Batch" ></e-edit-settings> 
    <e-toolbar-settings show-toolbar="true"  toolbar-items="@(new List<string>() { "add", "edit", "delete", "cancel", "update”})"></e-toolbar-settings> 
     
    <e-datamanager url="/Home/DataSource" batch-url="/Home/BatchUpdate" adaptor="UrlAdaptor"></e-datamanager> 
    <e-columns> 
. . . 
          
    </e-columns> 
</ej-grid> 
 
@server side code 
public ActionResult BatchUpdate([FromBody]CRUDModel value) 
        { 
 
            //do stuff 
 
 
        } 

Screenshot 1
 
Screenshot 2
 
Please let us know if you have any further assistance on this. 
Regards, 
Venkatesh Ayothiraman. 


Hassan
Replied On April 3, 2017 12:16 PM UTC

Thanks for guidance

Syntax Code available for ASP.NETCore does not work(bind to sqlserver database(BatchUpdate and CellEditUpdate and CellEditInsert and CellEditDelete and ...)

bind grid to sqlserver database and CRUD by Inline , Batch or dialog.

meantime the http://aspnetcore.syncfusion.com/grid/batchediting of asp.netcore Syncfusion Help for syntax controllers 
is Empty

Please help me to solve the problem.


Alan Sangeeth S [Syncfusion]
Replied On April 4, 2017 01:18 PM UTC

Hi Hassan,  
  
Sorry for the inconvenience.  
  
Query 1: “Syntax Code available for ASP.NETCore does not work 
Please confirm whether the solution in previous update has resolved your problem or if you still facing issue please send us more information so that we provide you solution as early as possible. 
 
Query 2: “asp.netcore Syncfusion Help for syntax controllers is Empty 
We have created a separate incident for this query. Please log in to following link for follow-up with the incident. 
  
Regards,  
Alan Sangeeth S 



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.

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

;