I have this control
@(Html.Kendo().DropDownTreeFor(model=>model.NewCustomerCategoryCode)
.DataTextField("Name")
.DataValueField("id")
.AutoWidth(true)
.HtmlAttributes(new { style = "width: 100%" })
.DataSource(dataSource => dataSource
.Read(read => read
.Action("Read_DropDownTreeNewCustomerCategoriesData", "ListBox")
)
)
.Filter(FilterType.Contains)
.LoadOnDemand(true)
)
And this is the action
public
JsonResult Read_DropDownTreeNewCustomerCategoriesData(
string
id)
{
var result = GetHierarchicalNewCustomerCategoryData()
.Where(x => String.IsNullOrEmpty(id) ? x.ParentCode ==
null
: x.ParentCode == id)
.Select(item =>
new
{
id = item.Code,
Name = item.Name,
hasChildren = item.HasChildren
});
return
Json(result);
}
I set correctly a value (and stored to database), but when I reopen a card it cannot get a value correctly.
When I try to debug into Action id parameter is not valued.
Why?