Can you preload deafult option into a telerik dropdownlist?

0 Answers 4 Views
DropDownList
Charlston
Top achievements
Rank 1
Charlston asked on 25 Sep 2025, 03:29 PM

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



No answers yet. Maybe you can help?

Tags
DropDownList
Asked by
Charlston
Top achievements
Rank 1
Share this question
or