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.
Syncfusion Feedback

ASP.NET MVC GRID CRUD example with Entity Framework (Database First) and save change to database.

Thread ID:

Created:

Updated:

Platform:

Replies:

130548 May 17,2017 05:39 PM UTC May 19,2017 12:21 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Martin
Asked On May 17, 2017 05:39 PM UTC

Hi,

I would like to have an example with ASP.NET MVC GRID with Entity Framework Database First
and how to save the change to the database.

thanks for your help.
MK

Venkatesh Ayothi Raman [Syncfusion]
Replied On May 19, 2017 12:21 AM UTC

Hi Martin, 
Thanks for contacting Syncfusion support. 

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

In this sample, we have bounded the Grid with Entity framework and enable the CRUD operations through EditSettings in Grid. Please refer to the following code example and Help documentation, 

Code example
@GRID 
 
@(Html.EJ().Grid<object>("FlatGrid") 
        .Datasource((IEnumerable<object>)ViewBag.datasource) 
                . . . 
              .SelectionType(SelectionType.Single) 
              .EditSettings(edit=>{edit.AllowAdding().AllowDeleting().AllowEditing(); }) 
              .ToolbarSettings(toolbar => 
                { 
                 toolbar.ShowToolbar().ToolbarItems(items => 
                 { 
                  items.AddTool(ToolBarItems.Add); 
                  items.AddTool(ToolBarItems.Edit); 
                  items.AddTool(ToolBarItems.Delete); 
                  items.AddTool(ToolBarItems.Update); 
                  items.AddTool(ToolBarItems.Cancel); 
                }); 
              }) 
        .Columns(col => 
        { 
            . . . 
        })) 



If you want to perform the server side operation while using Entity framework, then we suggest to you use remoteSave adaptor. Please refer to the following Help documentation for more information, 

Regards, 
Venkatesh Ayothiraman. 


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

;