Skip to content

Сonfigure the grid's edit functionality to update the values of hidden columns.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-mvc-update-data-in-hidden-columns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid View for ASP.NET MVC - How to update data in hidden columns

This example demonstrates how to configure the grid's edit functionality to update the values of hidden columns.

Update data in hidden columns

Overview

Handle the grid's server-side CustomJSProperties event to get the edited row values and pass them to the client.

settings.CustomJSProperties = (sender, e) => {
    MVCxGridView gridView = (MVCxGridView)sender;
    if (gridView.EditingRowVisibleIndex > -1) {
        e.Properties["cpMiddleName"] = gridView.GetRowValues(gridView.EditingRowVisibleIndex, "MiddleName");
    }
};

To pass the values from the server to the update action method, handle the grid's client-side BeginCallback event.

settings.ClientSideEvents.BeginCallback = "function(s, e) { if(s.cpMiddleName) e.customArgs['MiddleName'] =  s.cpMiddleName; }";

Files to Review

Documentation