This question is locked. New answers and comments are not allowed.
I have this Editor Template:
With this CodeBehind:
The selectList is filled correctly.
Additionally I have this script, that I have bound to the onEdit Event of the Grid:
And this is the Model:
The Drowdown shows to be very small and empty.
When I debug the java script it does not find the variable data. After the statement data is still null.
See screenshot.
<%@ Control Language="C#" Inherits="AdaptiveWebRole.Views.SprintSelectionControl" CodeBehind="~/Views/Shared/EditorTemplates/SprintSelection.ascx.cs" %><% buildDropDown().Render(); %>With this CodeBehind:
namespace AdaptiveWebRole.Views{ public class SprintSelectionControl : ViewUserControl<Sprint> { public DropDownListBuilder buildDropDown() { var viewDataSprints = ViewData["sprints"] as IEnumerable<Sprint>; var list = new List<Sprint>(); list.Add(new Sprint {RowKey=String.Empty, Title="<none>"}); viewDataSprints.ToList().ForEach(vds => list.Add(vds)); var selectList = new SelectList(list, "RowKey", "Title"); var dropDown = Html.Telerik().DropDownList() .Name("SprintModel") .BindTo(selectList); return dropDown; } }}The selectList is filled correctly.
Additionally I have this script, that I have bound to the onEdit Event of the Grid:
function onEditWorkitemGrid(e) { var form = $(e.form); var sprintModel = form.find('#SprintModel'); var data = sprintModel.data('tDropDownList'); data.select(function (dataItem) { var text = dataItem.Text; var sprintModelContent = e.dataItem['SprintModel']; var result = text == sprintModelContent; return result; });}And this is the Model:
public class WorkitemGridRow : Models.Workitem { public WorkitemGridRow(Workitem wi) : base(wi) { } public WorkitemGridRow() { } [UIHint("SprintSelection")] public Models.Sprint SprintModel { get; set; } // etc.}The Drowdown shows to be very small and empty.
When I debug the java script it does not find the variable data. After the statement data is still null.
See screenshot.