Please find the below code as i want to set default value of dropdown instead of optionlable from JSON data which is returned
from controller .
Please find the below code
public ActionResult GetOrders()
{
List<usp_IDQ_GetLicenseDistrictsVO> objresult1 = new List<usp_IDQ_GetLicenseDistrictsVO>();
objresult1 = objConnection.usp_IDQ_GetLicenseDistricts(User.Identity.Name, true).ToList();
return Json(objresult1, JsonRequestBehavior.AllowGet); ;
}
@(Html.Kendo().DropDownList()
.Name("DropDownList1")
//.Events(ev => ev.DataBound("SalesPersonID_DataBound"))
.OptionLabel("Select ...")
.HtmlAttributes(new { style = "width:300px" })
.OptionLabel("Select ...")
.DataTextField("District_Id")
.DataValueField("Location_ID")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetOrders", "IDTDashboard");
})
.ServerFiltering(true);
})
.AutoBind(false)