This question is locked. New answers and comments are not allowed.
Does the MVC Grid support showing dynamic properties from a DynamicObject model?
Let me explain my scenario. This is a sample model:
This is a sample controller:
And this is an extract of the view:
Neither approach works as expected for me. Is there a way to accomplish what I want?
Thanks for your help.
Let me explain my scenario. This is a sample model:
Public Class ModelX Inherits Dynamic.DynamicObjectEnd ClassThis is a sample controller:
Public Class DemoController Inherits Controller Public Function Index() As ActionResult Dim list As New List(Of ModelX) Dim item As Object item = New ModelX item.PropertyA = 1 item.PropertyB = "Something" list.Add(item) item = New ModelX item.PropertyA = 2 item.PropertyB = "Something else" list.Add(item) item = New ModelX item.PropertyA = 3 item.PropertyB = "Another thing" list.Add(item) Return View(list) End FunctionEnd ClassAnd this is an extract of the view:
myGrid.Columns(Sub(header As Telerik.Web.Mvc.UI.Fluent.GridColumnFactory(Of TModelo)) 'this approach header.Bound("PropertyA") 'or this another header.Bound(Of Integer)(ExpressionBuilder.Expression(Of TModelo, Integer)("PropertyA")) '...Neither approach works as expected for me. Is there a way to accomplish what I want?
Thanks for your help.