Hi Mark,
Thanks for contacting Syncfusion support.
You can set a selected item value using model binding in DropdownlistFor control. Please refer to the code snippet:
@using (Html.BeginForm())
{
Html.EJ().DropDownListFor(model => model.bikeValue, (Syncfusion.JavaScript.Models.DropDownListProperties)ViewData["ddl"]).WatermarkText("Select a car").Width("100%").Render();
Html.EJ().Button("btn").Size(ButtonSize.Small).Text("Post").Type(ButtonType.Submit).Width("50%").Render();
}
[HttpPost]
public IActionResult Index(BikeModel model)
{
DropDownListProperties ddl = new DropDownListProperties();
ddl.DataSource = GetDataSource();
DropDownListFields ddf = new DropDownListFields();
ddf.Text = "text";
ddf.Id = "empid";
ddl.DropDownListFields = ddf;
model.bikeValue = "Pulsar";
ViewData["ddl"] = ddl;
return View(model);
}
Regards,
Karthikeyan V.