Search code examples
asp.net-mvc-3telerik-mvc

asp.net mvc bind to telerik grid without model


Is it possible to bind an object collection to telerik mvc control without defining the model.


Solution

  • What exactly you mean without model?

    If you are talking about the model which is defined for view - strongly typed view then yes it is possible to bind it. You need to specify the type of the model like this Html.Telerik().Grid<YourType>((IEnumerable<YourType>)Model)

    If you are talking about omitting the Grid type declared here - then you can specify dinamic type there and use the approach covered in this code library to successfully bind the grid. http://www.telerik.com/community/code-library/aspnet-mvc/grid/binding-to-a-collection-of-dynamic-objects-with-mvc3-razor.aspx

    I hope this is what you search for.