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!

+3


source to share


2 answers


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



+1


source


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.



+1


source







All Articles