Breaking News

c# – sending back edited datagrid to controller in devextreme-Exceptionshub

Questions:

I just started using devextreme.

I currently build a web UI using asp.net core mvc 6 framework, and I am working using visual studio 2019. How do I send back the edited datagrid to my controller?

For example:

Model:

public class student 
{ public string name {get;set;}
  public int age {get;set;}
}

Controller:

public class StudentController:Controller
{
    List StudentData = new List();
    StudentData.Add(new student(){name="John", age=17},
                    new student(){name="Doe", age=18})

    ViewBag.Student = StudentData;
}

View:

@(Html.DevExtreme().DataGrid()
     .ID("gridContainer")
     .Scrolling(s => s.ColumnRenderingMode(GridColumnRenderingMode.Virtual))
     .Paging(p => p.Enabled(false))
     .ShowBorders(true)
     .Height(600)
     .ColumnAutoWidth(true)
     .Editing(editing =>
                 {
                 editing.Mode(GridEditMode.Cell);
                 editing.AllowUpdating(true);
                 editing.AllowAdding(false);
                 })
      .DataSource(ViewBag.Student)   
      )

So, once the user edited the data grid, I would like to send the edited list of object back to the controller.
Can someone guide me on how to do this?

Thanks in advance.

How to&Answers:

About rankhawks

Check Also

jQuery offline slideshow on Android-Exceptionshub

(function($){ $.fn.chocolate = function(args) { // Default Options var options = $.extend({ interval : 1000, …

c# – How to handle mocking (Rhino Mock) and unity container in different unit test classes?-Exceptionshub

Questions: I am working on a large desktop application. The application communicates with number of …

javascript – Actualize Database Data with Functions Cloud-Exceptionshub

Questions: I am developing an Android application and I have a problem that I cannot …

valgrind for Android devices (Crystax). configure: error: C compiler cannot create executables-Exceptionshub

Questions: Using and adapting the script(https://gist.github.com/smits/27060b310546ca6f76568f24838118c3) I get and error ” C compiler cannot create …

c# – Save position of Snake and Detect Collison with it self. Whats wrong?-Exceptionshub

Questions: using System; using System.Windows.Forms; using System.Collections.Generic; using System.Drawing; using OpenTK; using OpenTK.Graphics.OpenGL; using OpenTK.Graphics; …

Leave a Reply

Your email address will not be published. Required fields are marked *