Dynamic model with Telerik ASP MVC
Has anyone found a way to dynamically create a grid using ExpandoObject, DynamicObject, or Reflection.Emit and still allow CRUD operations?
I was able to use Reflection.Emit to dynamically create grid columns and display the data, but as soon as I try to edit the row, the cell content disappears.
Any help would be greatly appreciated!
source to share
There is a project showing how to use dynamic objects with Telerik networking for ASP.NET MVC. You can find it here: http://www.telerik.com/community/code-library/aspnet-mvc/grid/binding-to-a-collection-of-dynamic-objects-with-mvc3-razor.aspx
source to share
I managed to solve the problem using this code. The usual JavaScriptSerializer
one used by ASP.NET MVC to generate the JSON output serializes ExpandoObject
similarly IDictionary<string, object>
so that instead of the required JSON object, the array data
actually contains a list of key-value pairs that ASP.NET MVC Telerik mesh cannot handle.
source to share