This question is locked. New answers and comments are not allowed.
Hi,
I want to have a DropDownList inside a Grid (grid is not editable). I use Ajax binding and a ClientTemplate to show the dropdownlist. The DropDownList is shown but I'm not able to set the selected item and the events are not called.
My javascript functions onDataBound and OnChange are not called. And <#= Detail.IsUsedAs.ID #> does not work to set the selected value.
Thanks in advance.
Best regards
I want to have a DropDownList inside a Grid (grid is not editable). I use Ajax binding and a ClientTemplate to show the dropdownlist. The DropDownList is shown but I'm not able to set the selected item and the events are not called.
@(Html.Telerik().Grid<Item>() .Name("MyGrid") .DataBinding(dataBinding => dataBinding.Ajax() .Select("LoadItems", "Actions")) .DataKeys(keys => keys.Add(m => m.Detail.ID)) .Columns(columns => { columns.Bound(m => m.Detail.Model).ReadOnly(); columns.Bound(m => m.Detail.Nr).ReadOnly(); columns.Bound(m => m.Detail.Name).ReadOnly(); columns.Bound(m => m.Detail.IsUsedAs).ClientTemplate("" + Html.Telerik().DropDownList().Name("isusedas_<#=ID#>")
.BindTo(new SelectList(ViewBag.IsUsedAsValues, "ID", "Value", "<#= Detail.IsUsedAs.ID #>"))
.ClientEvents(e => e.OnChange("onChange").OnDataBound("onDataBound"))
.HtmlAttributes(new { style = "width:93%;" })
.Encode(false)).Encoded(false);}).Scrollable(c => c.Height("400px")).Sortable().Footer(false) )My javascript functions onDataBound and OnChange are not called. And <#= Detail.IsUsedAs.ID #> does not work to set the selected value.
Thanks in advance.
Best regards