I have a grid with Updating feature turn on using the GridModel class, but when I click on the row the row gets in edit mode and all the data in the row gets deleted. Can you please help with this?
List<GridColumn> columns = new List<GridColumn>()
{
new GridColumn("ID", "ID", "int", "100px"),
new GridColumn("Code", "Code", "string", "100px"),
new GridColumn("Description", "Description", "string", "100px"),
}
GridModel model = new GridModel("grid1", "ID", columns, Url.Action("GetList/"));
GridUpdating updating = new GridUpdating();
model.Features.Add(updating);
return
PartialView(model);
Hi,
This is because the type of the primaryKey column is with not correct format.
You have to change type of column ID from int to number:
new GridColumn("ID", "ID", "number", "100px")
insted of
new GridColumn("ID", "ID", "int", "100px")
Hope this helps,
Nadia