This question is locked. New answers and comments are not allowed.
Hello,
I want to bind the Grid to dynamic objects like in this page: http://blogs.telerik.com/rosenkonstantinov/posts/10-11-12/binding_to_a_collection_of_dynamic_objects_with_grid_extension_for_asp_net_mvc.aspx
Basic example that does not work:
Controller code
View code (Razor engine):
"Orders" is correctly mapped in the Entity Model and has a property "reference".
But when executing this page, I get the error message:
Invalid property or field - 'reference' for type: Object
So why this code does not work?
Thank you in advance for your answer.
I want to bind the Grid to dynamic objects like in this page: http://blogs.telerik.com/rosenkonstantinov/posts/10-11-12/binding_to_a_collection_of_dynamic_objects_with_grid_extension_for_asp_net_mvc.aspx
Basic example that does not work:
Controller code
public class OrderController : Controller public ActionResult Index() { BaseEntities context; context = new BaseEntities (); var orders = ((from order in context.Orders select new { reference = Order.reference } )); return View(orders); }}View code (Razor engine):
@using Telerik.Web.Mvc.UI@model IEnumerable<dynamic>@( Html.Telerik().Grid(Model).Name("Grid") .DataKeys(dataKeys => dataKeys.Add("reference")) .Columns(columns => { columns.Bound("reference"); }) .Pageable() .Sortable() .Groupable() .Filterable())"Orders" is correctly mapped in the Entity Model and has a property "reference".
But when executing this page, I get the error message:
Invalid property or field - 'reference' for type: Object
So why this code does not work?
Thank you in advance for your answer.