This question is locked. New answers and comments are not allowed.
Is it possible to pass the entire object being bound to a bound column instead of just a property? One of my columns is going to be a dropdown list based on the Status property of the model that the row is being bound to. What I want to do is pass the model into an Html helper, so I can make sure that the dropdown list has the correct options in it.
Here's my grid code:
So I guess my question is two-fold: 1.) Is what I want to do even possible? and 2.) How do I do it?
Thanks!
UPDATE:
I was able to work around this by making a property on my model object that creates the dropdown list, so the code for that column looks like:
I am still interested to know if what I asked in the initial post is possible though.
Here's my grid code:
Html.Telerik().Grid<TopicModel>() .Name("TopicsGrid") .Columns(columns => { columns.Bound( o => o.Title );
columns.Bound( o => o.SectionName );
columns.Bound( o => o.LastUpdated ); columns.Bound( o => o.Status ); columns.Bound( o => o.ID ) .Title( "Action" ) .ClientTemplate( Html.ActionSelect( DATACONTEXT ) ); }) .DataBinding( dataBinding => { dataBinding.Ajax() .Select( "_AuthorGridSelect", "Dashboard" ); }) .Pageable() .Sortable() .Scrollable() .Filterable()So I guess my question is two-fold: 1.) Is what I want to do even possible? and 2.) How do I do it?
Thanks!
UPDATE:
I was able to work around this by making a property on my model object that creates the dropdown list, so the code for that column looks like:
columns.Bound( o => o.ActionSelect ) .Title( "Action" ) .ClientTemplate( "<#= ActionSelect #>" );I am still interested to know if what I asked in the initial post is possible though.