Unplanned
Last Updated: 23 Apr 2024 12:04 by Laurie
Laurie
Created on: 23 Apr 2024 12:04
Category: DropDownTree
Type: Bug Report
0
DropDownTreeFor with checkboxes enabled is not binding to model value after postback.

Bug report

DropDownTreeFor with checkboxes enabled is not binding to model value after postback.

Reproduction of the problem

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"))
                 )
             )
 )

Current behavior

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.

Expected/desired behavior

The DropDownTree should be bound to the model value after successful form submission.

Workaround

Bind the model to a string[] instead of int[].

Environment

  • Kendo UI version: 2024.1.319
0 comments