DropDownTree TagHelper throws error when the BindTo configuration is set.
bind-to
TagHelper attribute.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.)
Setting the bind-to should not produce a run-time error.
DropDownTree is not serialized correctly when declared in the Template component.
The DropDownTree is not serialized correctly when declared in the Template component.
The DropDownTree is not serialized correctly when declared in the Template component.
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.