Use the Value method. See the sample code below.
@(Html.Kendo().DropDownList() .Name("DropDownListName") .DataTextField("Text") .DataValueField("Value") .BindTo(model.DropDownListItems) .Value(model.Selected) )
EDIT: DropDownList needs to be bound to List<SelectListItem> and it can be initialized as shown below.
var items = new List<SelectListItem> { new SelectListItem { Text = "Item0", Value = "0" }, new SelectListItem { Text = "Item1", Value = "1" } };
In addition, I would recommend using MVVM to attach it to the view.
public class DropDownViewModel { public String Selected; public List<SelectListItem> DropDownListItems; public DropDownViewModel(String selected, List<SelectListItem> dropDownListItems) { Selected = selected; DropDownListItems = dropDownListItems; } }
source share