I trying to create a dynamic populated tree view with check-boxes here is an example of the structure:
company 1 =>
department 2 =>
Employees 3 =>
emp 2.1.2 and so on ......
The idea is when comp 1 is selected then department and Employee should change the children based on company selected, like the cascading Drop Down List.
Can you please provide me with a sample on how to populate and change treeview on selection, using RazorPages(not razor syntax) witch will hook into the dataprovider. As we are coding against aspnetcore 3.0 the OData sample is not an option yet because OData support for this version is not stable yet.
I have been looking for a example using the e-data-manager to populate the treeview using querying with url-adaptor but wasn't able to find a suitable one and i could not find AspnetCore Ej2 Docs on Data-Manager
KRKeerthana Rajendran Syncfusion Team November 20, 2019 06:58 AM
Thanks for contacting Syncfusion support.
In our TreeView component , we have an event NodeChecked to identify the node checked/unchecked successfully. Using this event, you can identify the corresponding node checked/unchecked in TreeView component. If comp 1.1 node is selected, then we need a key or id to map with child items ; so that we can hide or show the node items based on the selection. In TreeView dataSource, we have added ConncetId attribute to identify the child items. After mapped with the result child items, store the result in array. We have provided disableNodes and enableNodes method to disable and enable the node in TreeView. After disable the nodes you can add the custom style for the element to hide from the component.
We have prepared sample same as your mentioned structure for your convenience. Kindly refer to the below link for the sample.
We will also include a topic for rendering TreeView using UrlAdaptor in our UG document by Volume 4 release.
Please let us know, if you need any further assistance on this.
ACACMNovember 26, 2019 06:05 AM
Just what i was looking for and like always verry good and fast support.
KRKeerthana Rajendran Syncfusion Team November 26, 2019 11:23 PM
Most welcome. We are glad to hear that the provided solution helped you to achieve your requirement. Please get back to us if you need any further assistance on this.