When I edit a single column, the event to save changes does not trigger

Hi, I have a grid with this code in .cshtml:
<h2>URL adaptador test</h2>

@(Html.EJ().Grid<object>("FlatGrid")
    .Datasource(dataSource=>dataSource.URL(Url.Action("DataSource","URL",null,Request.Url.Scheme))
        .UpdateURL(Url.Action("Update","URL",null,Request.Url.Scheme))
        .InsertURL(Url.Action("Insert","URL",null,Request.Url.Scheme))
        .RemoveURL(Url.Action("Remove","URL",null,Request.Url.Scheme))
        .Adaptor(AdaptorType.UrlAdaptor))
    .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().RowPosition(RowPosition.Bottom).EditMode(EditMode.ExternalForm); })
    .Locale("es-MX")
    .ToolbarSettings(toolbar =>
    {
        toolbar.ShowToolbar().ToolbarItems(item =>
        {
            item.AddTool(ToolBarItems.Add);
            item.AddTool(ToolBarItems.Cancel);
            item.AddTool(ToolBarItems.Delete);
            item.AddTool(ToolBarItems.Edit);
            item.AddTool(ToolBarItems.Update);
        });
    })
    .AllowPaging()
    .AllowReordering()
    .IsResponsive()
    .PageSettings(p => { p.PageSize(5); })
    .AllowResizeToFit()
    .AllowSorting()
    .Columns(columns=>
    {
        columns.Field("AlbumId").HeaderText("Album ID").IsPrimaryKey(true).IsIdentity(true).Add();
        columns.Field("Titulo").ValidationRules(v => v.AddRule("required", true).AddRule("messages", "{required:'requeridos'}")).Add();
        columns.Field("ArtistaId").HeaderText("Artista").ForeignKeyField("ArtistaId").ForeignKeyValue("Nombre").DataSource((IEnumerable<object>)ViewBag.DataSourceArtista).ValidationRules(v => v.AddRule("required", true)).Add();
        columns.Field("GeneroId").HeaderText("Genero").ForeignKeyField("GeneroId").ForeignKeyValue("Nombre").DataSource((IEnumerable<object>)ViewBag.DataSourceGenero).ValidationRules(v => v.AddRule("required", true)).Add();
        columns.Field("Precio").Format("{0:C2}").EditType(EditingType.NumericEdit).ValidationRules(v => v.AddRule("required", true)).Add();
        columns.Field("AlbumArtURL").Add();
    })
    .ClientSideEvents(e => { e.ActionComplete("complete").ActionBegin("begin").EndEdit("endEdit").EndAdd("endAdd").ActionFailure("fail"); })
    )

(When I execute my code I already have some data to show in the grid)
When editing a record, if I only edit one column (columns.Field ("AlbumArtURL"). Add ();), the event to save changes does not trigger
But if I edit another column, just one or several (along with the one I can not), it does it without problems
NOTE: For the data that is loaded in the grid, for the column "Album ArtURL" the value of all the records is null.
I hope you can help me please.
Thank you

1 Reply

SE Sathyanarayanamoorthy Eswararao Syncfusion Team June 25, 2018 03:53 PM UTC

Hi Juan, 

Thanks for contacting Syncfusion support. 

We suspect that the mentioned issue may occur that you have given null values for the column. If the column has null values then the type for that column will be undefined. Since the type is undefined while editing the particular column the update action is not called.  

To avoid the mentioned issue, we suggest you to specify the respective type for the column. Please refer the below documentation link for details of column type.  


Please refer the below code example. 


 
@(Html.EJ().Grid<OrdersView>("Grid") 
                    .Datasource(ds => ds.URL("/Home/UrlDataSource").UpdateURL("/Home/UrlUpdate").InsertURL("/Home/UrlInsert").RemoveURL("/Home/UrlDelete") 
                    .Adaptor(AdaptorType.UrlAdaptor)) 
                     
                                      …... 
                    .Columns(col => 
                    { 
                        col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); 
                        col.Field("CustomerID").HeaderText("Customer ID").Width(90).Add(); 
                        col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(90).Add(); 
                        col.Field("ShipCity").Type("string").Add(); 
                    }) 
) 
 
 

If you need any further assistance please get back to us. 

Regards, 
Sathyanarayanamoorthy 


Loader.
Up arrow icon