We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Hierarchial treeview with 2 levels of sub-children and adding a child dynamically

Hi,

1. Could you please send me an example of Hierarchial treeview with 2 levels of children as REMOTE Data?
2. Also, could you please let me know how I could add a new item on right click add option?

Country
{
Guid Id 
String Name
string State // Child
}

State
{
Guid Id 
String Name
string City// Child
}

City
{
Guid Id 
String Name
}

example:

India
-TamilNadu
---Chennai
---Coimbatore
-Karnataka
---Bangalore
---Mangalore

Thank you.

3 Replies

CI Christopher Issac Sunder K Syncfusion Team February 19, 2019 11:38 AM UTC

Hi John, 

Thank you for contacting Syncfusion support. 

Here are the answers for your queries, 

Query-1 : Hierarchial treeview with 2 levels of children as REMOTE Data 
You can achieve this requirement in offline mode of the remote data. Please find the code snippet 
 
<e-treeview-fields id="id" text="name"> 
    <e-data-manager url="/Treeview/GetAllData" adaptor="ODataV4Adaptor" crossDomain="true" offline="true"></e-data-manager> 
</e-treeview-fields> 
 
Query-2Adding a new item on right click add option 
You can achieve this by integrating context menu in your application. You can add the ‘New Item' in the 'select’ event of context menu. We have prepared the sample based on the above queries. Please check the sample from the following link 


Please let us know if you require any further assistance. 

Thanks, 
Christo


JS John Stephen Mangam February 20, 2019 05:34 AM UTC

Thanks a lot, Christopher.



SI Silambarasan I Syncfusion Team February 21, 2019 04:39 AM UTC

Hi John, 
 
Thanks for your update. Please check the provided solution and get back to us if you require further assistance on this. We are happy to help you out. 
 
Regards, 
Silambarasan 


Loader.
Live Chat Icon For mobile
Up arrow icon