This is a migrated thread and some comments may be shown as answers.

[Solved] How to load a different select list in the combo box editor template, for each row of grid?

0 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason
Top achievements
Rank 1
Jason asked on 13 May 2011, 11:55 PM
I have a grid that is bound to my model, and I use an editor template to provide a combobox to select the value of one column when the row is in edit mode.

Here is my editor template:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%= Html.Telerik().DropDownList()
.Name(
"Originator")
.BindTo(
new SelectList((IEnumerable)ViewData["Originators"], "OriginatorId", "Name"))
%>

The problem is my editor is loaded with the same SelectList for every row in the grid; I need to load a different set of data for each row, based on model properties bound to that row. 

Has anyone done this?


Cheers,

Jason
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Share this question
or