This question is locked. New answers and comments are not allowed.
MVC3
I'm using Telerik grid with a Html.Telerik().DropDownListFor . I need to recreate this dropdown after ajax sorting, but I'm having a real problem maintaining the same behavior. I know it needs to go into a ClientTemplate ... but how?
I'm using Telerik grid with a Html.Telerik().DropDownListFor . I need to recreate this dropdown after ajax sorting, but I'm having a real problem maintaining the same behavior. I know it needs to go into a ClientTemplate ... but how?
<% int Iter = 0; %><%Html.Telerik().Grid(Model.SearchResults)
.Name("Grid") .TableHtmlAttributes(new { summary = "Manage Class Properties" }) .HtmlAttributes(new { @style = "font-size: .9em; font-family: Arial, Verdana, Helvetica, Sans-Serif; padding-bottom: 0;margin-top:0;" }) .DataBinding(databinding => databinding.Ajax().Select("_ManageClassPropertiesResults", "Administration", new { QuarterCode = Model.QuarterCode, instructor = Model.Instructor, courseName = Model.CourseName })) .Columns(columns =>{ columns.Bound(model => model.QuarterName) .Title("Quarter") .Width(60); columns.Bound(model => model.ProgramLevelCode) .Title("Program Level") .Width(70); columns.Bound(model => model.InstructorName) .Title("Instructor") .Width(110); columns.Bound(model=> model.SiteDescription) .Template(o =>{ %><%: Html.HiddenFor(model => Model.SearchResults[Iter].CourseId)%><%: Html.TextBoxFor(model => Model.SearchResults[Iter].SiteDescription, new { maxlength = "50" })%><% }) .ClientTemplate("<input id='SearchResults_" + Iter + "__CourseId' name='SearchResults[" + Iter + "].CourseId' type='hidden' value='<#= CourseId #>' /><input id='SearchResults_" + Iter + "__SiteDescription' maxlength='50' name='SearchResults[" + Iter + "].SiteDescription' type='text' value='<#= SiteDescription #>' />") .HtmlAttributes(new { style = "font-size:.95em;" }) .Title("Site Description") .Width(160); columns.Bound(model => model) .Template(o =>{%><%: Html.Telerik().DropDownListFor(model => Model.SearchResults[Iter].ClassTimingCode) .BindTo(new SelectList(Model.ClassTimingList, "Value", "Text")) .HtmlAttributes(new { style = "font-size: .95em; width: 120px; background-color: #fff; border:0;" }) .DropDownHtmlAttributes(new { style = "font-size: .95em; width: 120px; border-color: #cccccc;" })%><%}) .Title("Class Timing") .Width(110); columns.Template(o =>{%><% Iter = Iter + 1; %><%}) .ClientTemplate(" Iter = Iter + 1;") .Hidden(); columns.Template(o =>{%><%: Html.HiddenIndexerInputForModel() %><%}) .ClientTemplate("" + Html.HiddenIndexerInputForModel() + "") .Hidden(); }) .Sortable() .Pageable(paging => paging.Style(PagerStyles).PageSize(25, new[] { 5, 10, 15, 25, 50, 200 }).Position(POSITION)) .NoRecordsTemplate("<p class='instructions'>No Records Available</p>") .Render(); %>