I am trying to preload deafult value that will always exist in this downdownlist no matter when. Then load in another list from the data base behind it base on other factors. See test code below.
@(Html.Kendo().DropDownList()
.Name("groupTypeFilter")
.HtmlAttributes(new { @class = "form-select", data_alpa = "filter", onchange = "ApplyFilter(this)" })
.OptionLabel("All")
.DataTextField("Text")
.DataValueField("Value")
.BindTo(new List<SelectListItem>
{
new SelectListItem { Text = "All", Value = "all" },
new SelectListItem { Text = "All GMS Groups", Value = "allgms" },
new SelectListItem { Text = "All MECCOM Groups", Value = "allmeccom" }
})
.DataSource(config => config.Read("GetGroupTypes", "Group"))
)
public JsonResult GetGroupTypes()
{
var groupTypes = new List<SelectListItem>
{
new SelectListItem { Text = "All", Value = "ALL" },
new SelectListItem { Text = "GMS", Value = "GMS" },
new SelectListItem { Text = "MEC/COM", Value = "MEC/COM" }
};
return Json(groupTypes);
}
It seems to be only load the data from the data call and not the deafult data that I loaded into it