Hi there,
I am using the MultiSelectFor control bound to a model property in a MVC 5 razor webpage. I am able to select multiple items and create data in our backend system - however, I am running into a few problems when editing this data.
Model property:
[DataType(
"MultiSelect"
)]
[Required]
public
List<
string
> Teams {
get
;
set
; }
Editor Template:
@model IList<
string
>
@Html.Kendo().MultiSelectFor(m => m)
.DataTextField(
"Text"
)
.DataValueField(
"Value"
)
.Filter(
"contains"
)
.AutoClose(
false
)
.Placeholder(
"Please Select"
)
.ValuePrimitive(
true
)
.Deferred()
.BindTo(selectList)
.ToClientTemplate();
The list it is bound to is an IEnumerable<SelectListItem>
When the screen loads, everything appears fine - the multiselect field is bound to the correct items and displays correctly.
However, if I attempt to remove one of the selected items by clicking on the delete option, I receive a javascript error in kendo.all.min.js:
0x800a138f - JavaScript runtime error: Unable to get property 'top' of undefined or null reference
The multiselect then appears to have lost it's list of values, which will only reappear if I start typing.
Any ideas what could be the issue here? If I expand the list first prior to deleting, I receive no issues when removing a selected item.
Thanks,
Paul.