Hi, I'm having a bit of trouble getting a multi select to pass the values back to the controller.
Here's what I have currently tried:
In my model:
[UIHint("abcEditor")] <- name of partial view containing the multiselect (used on grid popup window)
public string[] abc { get; set; }
In my partial view:
@using Kendo.Mvc.UI
@(Html.Kendo().MultiSelect()
.Name("abc") // Name of the widget matches in the model
.DataValueField("ID") <- PersonModel (Contains - ID, FullName, Email, etc..)
.DataTextField("FullName")
.BindTo((System.Collections.IEnumerable)ViewData["def"]) // A list of PersonModels which is populated in the controller
.Placeholder("Add")
)
Controller: (Received Values)
- model.abc {string[2]} string[]
[0] null string
[1] null string
ID is a Guid but if I try Guid[] I get the same result.
I can select things fine, and it returns an array with the correct number selected, but the values in the array are null?
If anyone can point me in the right direction it would be a great help!
Thanks
Here's what I have currently tried:
In my model:
[UIHint("abcEditor")] <- name of partial view containing the multiselect (used on grid popup window)
public string[] abc { get; set; }
In my partial view:
@using Kendo.Mvc.UI
@(Html.Kendo().MultiSelect()
.Name("abc") // Name of the widget matches in the model
.DataValueField("ID") <- PersonModel (Contains - ID, FullName, Email, etc..)
.DataTextField("FullName")
.BindTo((System.Collections.IEnumerable)ViewData["def"]) // A list of PersonModels which is populated in the controller
.Placeholder("Add")
)
Controller: (Received Values)
- model.abc {string[2]} string[]
[0] null string
[1] null string
ID is a Guid but if I try Guid[] I get the same result.
I can select things fine, and it returns an array with the correct number selected, but the values in the array are null?
If anyone can point me in the right direction it would be a great help!
Thanks