Hello,
When i bind the Multiselect list to ViewBag the list renders fine. However the "Values" property never gets set. I have tried with IEnumerable object as well as list<string> or string[] of ids. I cannot find any help online. When i post the viewmodel does post selected values.
I have also played with Autobind true and false
Here is the code
When i bind the Multiselect list to ViewBag the list renders fine. However the "Values" property never gets set. I have tried with IEnumerable object as well as list<string> or string[] of ids. I cannot find any help online. When i post the viewmodel does post selected values.
I have also played with Autobind true and false
Here is the code
@{
Html.Kendo().MultiSelectFor(model => model.ActivityIds)
.BindTo(new SelectList(ViewBag.Activity, "ActivityId", "ActivityName"))
.Value(new SelectList(ViewBag.SelectedActivites, "ActivityId", "ActivityName"))
.Placeholder("Select Activity ..")
.HtmlAttributes(new { style = "width: 800px;" })
.Render();
}
ViewBag.Activity = db.GetActivityList(Constants.APP_SC).ToList();
if
(smallCellViewModel.HasValue() && smallCellViewModel.ActivityIds.HasValue())
{
ViewBag.SelectedActivites = db.GetActivityList(Constants.APP_SC).Where(c=>smallCellViewModel.ActivityIds.
Contains(c.ActivityId)).ToList();
}