I have 3 drop down lists in this example. Lists 1 & 2 don't databind/populate. List3 works as intended. I don't understand what I have done wrong with Lists 1& 2.
@{
IEnumerable<VenueViewModel> ddlDataSource = (IEnumerable<VenueViewModel>)ViewBag.ddl_ds;
}
@Html.EJ().DropDownList("venueList1").Datasource(ddlDataSource).DropDownListFields(df => df.Text("VenueName")).ShowRoundedCorner(true).Enabled(true).WatermarkText("Select a Venue")
@Html.EJ().DropDownList("venueList2").Datasource((IEnumerable<VenueViewModel>)ViewBag.ddl_ds).DropDownListFields(df=>df.Text("VenueName")).ShowRoundedCorner(true).Enabled(true).WatermarkText("Select a Venue")
@Html.EJ().DropDownList("venueList3").TargetID("vlist").ShowRoundedCorner(true).Enabled(true).WatermarkText("Select a Venue")
<div id="vlist">
<ul>
@foreach (var v in ddlDataSource)
{
<li>@v.VenueName, @v.Weekday, @v.VenueId</li>
}
As always, any help is appreciated.
Thanks,
Chris
</ul>
</div>