DropDownTreeFor with checkboxes enabled is not binding to model value after postback.
Use the following definition of a DropDownTreeFor HtmlHelper in a plain HTML form, where MySelectedIds is int[]
:
@(Html.Kendo().DropDownTreeFor(m => m.MyClass.MySelectedIds)
.Checkboxes(checkboxes => checkboxes
.CheckChildren(false)
)
.DataTextField("MyText")
.DataValueField("MyId")
.AutoClose(false)
.CheckAll(true)
.DataSource(dataSource => dataSource
.Custom()
.Transport(t => t
.Read(r => r.Url("/api/items"))
)
)
)
The DropDownTree is bound to the model value on page load, but on successful form submission and returning the model the DropDownTree is not bound to the data. Refer to ticket 1648108 for a runnable example.
The DropDownTree should be bound to the model value after successful form submission.
Bind the model to a string[]
instead of int[]
.