Hi, im currently creating a Grid with dynamic columns and came across with this post and current following the structure.
Dynamic Data in the Kendo UI Grid (telerik.com)
My problem is that during Update, I cant seem to access the Property Values of those edited columns.
Can I get the actual code for the "Update" of this demo API?
https://demos.telerik.com/kendo-ui/service/products/Update
Heres my update code btw:
[HttpPost]
public JsonResult Update_Employee([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<dynamic> models)
{
foreach(var obj in models)
{
string a = GetProperty(obj, "EmployeeName");
}
return Json(ModelState.ToDataSourceResult());
}
private object GetProperty(dynamic obj, string propertyName)
{
var objDict = obj as IDictionary<string, object>;
if (objDict.ContainsKey(propertyName))
{
var value = objDict[propertyName];
if (value != null)
return value;
}
return null;
}