Hi
While page refreshes and reloads, DropDown list shows Drop Down's selected value in a textbox. Though Once page is loaded it is all fine. But for our purpose it is not desirable to show value that dropdown is binded to. If it had shown the selected text it would have been ok. We also don't want to hide the drop down untill page is ready and show it.
I dont see it is a performance issue as well since i created a seperate view and had only dropdown control in the entire view. Have provided sample code that you can execute to test the behavior
@model ViewModels.DdlVM
@using (@Html.BeginForm())
{
@(Html.Kendo().DropDownListFor(m => m.ddlprop)
.DataTextField("Text")
.DataValueField("Value")
.BindTo(Model.ddlOptions )
)
<input type="submit"
value="save" />
}
namespace ViewModels
{
public class DdlVM
{ public List<SelectListItem> ddlOptions { get; set; }
public string ddlprop{ get; set; }
}
}
controller
public ActionResult ClickMe()
{
DdlVM testvm = new DdlVM();
testvm.ddlOptions = new List<SelectListItem>();
for (int i = 0; i < 100; i++)
{
testvm.ddlOptions.Add(new SelectListItem()
{
Text = "TAB- " + i.ToString(),
Value = i.ToString()
});
}
return View("TestClickMe", testvm);
}
[HttpPost]
public ActionResult ClickMe(DdlVM testvm)
{
testvm.DelimiterOptions = new List<SelectListItem>();
for (int i = 0; i < 100; i++)
{
testvm.ddlOptions.Add(new SelectListItem()
{
Text = "TAB- " + i.ToString(),
Value = i.ToString(),
Selected = testvm.ddlprop== i.ToString()
});
}
return View("TestClickMe", testvm);
#endregion
}