DropDownTreeItemModel does not properly pass its HtmlAttributes members on populating DropDownTree with BindTo()
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;
}
The HTML attributes will not be passed to the DropDownTree items.
The HTML attributes should be passed and present in the DropDownTree items.