Completed
Last Updated: 18 Jan 2024 10:15 by ADMIN
Release 2024 Q1

Bug report

DropDownTree is not serialized correctly when declared in the Template component.

Reproduction of the problem

  1. Open the following Telerik REPL.
  2. Notice that the DropDowntTree component declared in the Template for the CustomerRating field is not serialized with its options correctly.

Current behavior

The DropDownTree is not serialized correctly when declared in the Template component.

Expected/desired behavior

The DropDownTree is not serialized correctly when declared in the Template component.

Environment

  • Kendo UI version: 2023.1.1114
  • Browser: [all]
Completed
Last Updated: 18 Jan 2024 10:16 by ADMIN
Release 2024 Q1

Bug report

DropDownTree TagHelper throws error when the BindTo configuration is set.

Reproduction of the problem

  1. Open the following Telerik REPL example.
  2. Create mocked DropDownTreeItemBase data that will be populated within the bind-to TagHelper attribute.
  3. Notice the observed error.

Current behavior

Setting the bind-to TagHelper attribute produces the following error

One or more errors occurred. (Object reference not set to an instance of an object.)

Expected/desired behavior

Setting the bind-to should not produce a run-time error.

Environment

  • Kendo UI version: 2023.3.1114
  • Browser: [all]
Unplanned
Last Updated: 23 Apr 2024 12:08 by ADMIN

### Bug report

The DropDownTree TagHelper with enabled checkboxes does not submit the selected options when it is bound to a Model property.

### Reproduction of the problem

1. Define a DropDownTree TagHelper as a form editor and and enable its checkboxes.

2. Bind the editor to a Model property (an array of integers).

3. Submit the form and examine the submit request payload. The values of the selected items are missing.

//Model
public class TestFormModelClass
{
  public int[] MonthsSelectedIds { get; set; }
}

//View
@model TestFormModelClass

<form method="post">
  <kendo-dropdowntree for="MonthsSelectedIds" 
      check-all="true"
      datatextfield="Month"
      datavaluefield="Id">
      <hierarchical-datasource type="DataSourceTagHelperType.Custom">
                <schema>
                    <hierarchical-model id="id"></hierarchical-model>
                </schema>
                <transport>
                    <read url="/api/items" />
                </transport>
      </hierarchical-datasource>
      <checkboxes check-children="false" name="CheckedMonths" enabled="true" />
  </kendo-dropdowntree>

  <button type="submit">Save</button>
</form>

### Expected/desired behavior

When the DropDownTree TagHelper with checkboxes is used as a form editor, the values of the selected items must be submitted as expected to the server.

### Workaround

Use the HtmlHelper version of the DropDownTree

### Environment

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

Unplanned
Last Updated: 23 Apr 2024 12:04 by Laurie

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
Completed
Last Updated: 10 Nov 2020 13:46 by ADMIN
Release 2020.R3.SP.next

Bug report

DropDownTreeItemModel does not properly pass its HtmlAttributes members on populating DropDownTree with BindTo()

Reproduction of the problem

In .Net Core application, implement the following view:

@(Html.Kendo().DropDownTree()
    .Name("kendoTreeItems")
    .BindTo((IEnumerable<DropDownTreeItemModel>)ViewBag.Items)
)

and the following controller:

public IActionResult Index()
{
    ViewBag.Items = GetItems();
    return View();
}

public IEnumerable<DropDownTreeItemModel> GetItems()
{
    IDictionary<string, string> attributes = new Dictionary<string, string>
    {
        { "style", "background: red" }
    };

            List<DropDownTreeItemModel> items = new List<DropDownTreeItemModel>
    {
        new DropDownTreeItemModel { Text = "Item 1", HtmlAttributes = attributes },
        new DropDownTreeItemModel { Text = "Item 2", HtmlAttributes = attributes },
        new DropDownTreeItemModel { Text = "Item 3", HtmlAttributes = attributes },
        new DropDownTreeItemModel { Text = "Item 4", HtmlAttributes = attributes },
    };

    return items;
}

Current behavior

The HTML attributes will not be passed to the DropDownTree items.

Expected/desired behavior

The HTML attributes should be passed and present in the DropDownTree items.

Environment

  • Kendo UI version: 2020.1.219
  • Browser: [all]