Completed
Last Updated: 15 Jul 2024 06:20 by ADMIN
Release 2024 Q3 (Aug)
Gordon
Created on: 26 Jun 2024 12:24
Category: DropDownTree
Type: Bug Report
0
DropDownTree TagHelper does not serialize "Value" and "Id" properties when using "bind-to" option

### Bug report

The DropDownTree TagHelper does not serialize the "Value" and "Id" properties when it is configured for local data binding (using the "bind-to" option).

### Reproduction of the problem

1) Use the following DropDownTree TagHelper configuration:

//Controller
public IActionResult Index()
{
            List<DropDownTreeItemModel> ddtData = new List<DropDownTreeItemModel>()
            {
                new DropDownTreeItemModel() { Id = "1", Text = "Option 1", Value = "S1" },
                new DropDownTreeItemModel() { Id = "2", Text = "Option 2", Value = "S2",
                    Items = new List<DropDownTreeItemModel>()
                    {
                        new DropDownTreeItemModel() { Id = "3", Text = "Option 3", Value = "S3" }
                    }
                }
             };
            ViewBag.StateTreeListData = ddtData;
            return View();
}

// View
<kendo-dropdowntree name="StateLocationDropDownTree" style="width: 100%"
                    height="500px"
                    auto-width="true"
                    bind-to="(IEnumerable<DropDownTreeItemModel>)ViewBag.StateTreeListData">
</kendo-dropdowntree>

2) When the DropDownTree is loaded, inspect its initialization script - the "value" and "id" properties are "null".

### Expected/desired behavior

The "Id" and "Value" properties must be serialized as the rest of the DropDownTreeItemModel properties.

### Environment

* **Telerik UI for ASP.NET Core version: 2024.2.514
* **Browser: [all]

0 comments