I have a grid where i have popup edit enabled. For this popup editing i have a template and in the template i have a multiselectfor which looks like this:
@(Html.Kendo().MultiSelectFor(x => x.SelectedConsultantIds)
.AutoClose(false)
.Placeholder("Select consultants")
.DataTextField("DisplayName")
.DataValueField("Id")
.IgnoreCase(true)
.Filter("contains")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAvailableConsultants", "Project");
});
})
)
When i load the grid the SelectedConsultantIds (List<string>) is populated for each item. I then click Edit for a row and the multiselectfor loads with all the DisplayNames preselected. However when i add new items to the multiselect from the selection they do not get added to the SelectedConsultantIds list when i click update and watch the viewmodel in the controller. The list stays the same if i only add. It does seem to update when i remove items from the list and click update.
So i can only remove items and not add items in this multiselect. The items get added and removed in the box itself, but not when i pass the viewmodel with the list to the controller.