Post Grid Data not working

2 posts, 0 answers
  1. Antonio Avanic
    Antonio Avanic avatar
    4 posts
    Member since:
    Jul 2008

    Posted 17 Oct 2016 Link to this post

    Model binding is not working with post values from Kendo UI MCV Grid, I follow the MVC5 example about this topic, the grid shows the editable collection but when I post the values the view model collection is always null.


                                          .Columns(columns =>
                                              columns.Bound(p => p.Id).Hidden();
                                              columns.Bound(p => p.ModuleId).Hidden();
                                              columns.Bound(p => p.Module.Name).Title("Modulo");
                                              columns.Bound(p => p.Name).Title("Opcion");
                                              columns.Bound(p => p.Selected).Title("Seleccionar").ClientTemplate("<input type='checkbox' #= Selected ? checked='checked' :'' # />"); ;
                                          .Editable(editable => editable.Mode(GridEditMode.InCell))
                                          .DataSource(dataSource => dataSource
                                                  .Model( m =>
                                                      m.Field(p => p.Id).Editable(false);
                                                      m.Field(p => p.ModuleId).Editable(false);
                                                      m.Field(p => p.Module.Name).Editable(false);
                                                      m.Field(p => p.Name).Editable(false);
                                                      m.Field(p => p.Selected);

  2. Eyup
    Eyup avatar
    3322 posts

    Posted 20 Oct 2016 Link to this post

    Hello Antonio,

    You've selected the Grid for ASP.NET Core as the Product of the thread. If you are using the MVC Core suite, please try adding the required lines in the Startup.cs as demonstrated in Step 4 here:

    Regardless whether you use MVC 5 or Core, you can use our live samples as a starting reference for implementing editing:

    I hope this will prove helpful.

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top