Hello,
we are changing our application from Telerik Controls to Kendo UI. But changing the TreeView is a little bit difficult. I hope you can help me:
With Telerik we used the OnDataBinding- Event, called a controller-class and bound a json-result to our tree: tree.bindTo(jsonObject)
Well this isn't possible with KendoUI.
So I tried the DataSource-thing on our tree:
@(Html.Kendo().TreeView()
.Name("TreeView")
.DataTextField("Text")
.DataImageUrlField("ImageUrl")
.DataUrlField("Url")
.DataSource(dataSource => dataSource
.Read(read => read
.Action("GetTreeData", "Home")
)
)
.ExpandAll(true)
Without all these DataTextField, DataImage.. stuff nothing worked so after hours I found out that I need them (there has to be a better documentation... please). But: How can I add ChildElements? With hasChildren (as a Property on the Json-Object) Ithe TreeView knows that there are children but I also wanna show them after binding (.ExpandAll(true).... <-- wanna use it!)
I really hope you can help me. I want to bind the complete tree-structure at once. No Load on demand. Is there any solution for doing that?
And if I have my complete tree... how am I able to rebind it? We need to refresh the tree very often, so I hope you can show me a possibility to do that.
Thank you very much!
Mathias