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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Access to tree in razorpage code when using UrlAdaptor to get remote data?

Thread ID:

Created:

Updated:

Platform:

Replies:

146149 Jul 23,2019 07:29 AM UTC Jul 25,2019 04:53 AM UTC Blazor 3
loading
Tags: TreeView
MikeR
Asked On July 23, 2019 09:43 AM UTC

When I try treeView.AddNodes,in the razor code, after fetching data successfully using the UrlAdaptor, I can't get the UI to update with new node. The code below just gets the root node independent of what the tree looks like:

List<object> treeData = await treeView.GetTreeData();


Kanagambigai Murugan [Syncfusion]
Replied On July 24, 2019 12:19 PM UTC

Hi Mike, 

Greetings from Syncfusion. 

You can dynamically add the tree nodes via AddNodes method using the following code snippet. 

public void addNodes() 
{ 
     List<object> listdata = new List<object>(); 
     listdata.Add(new 
        { 
            employeeID = this.index, 
            firstName = "NewItem", 
        }); 
         this.tree.AddNodes(listdata); 
         this.index = this.index + 1; 
} 

 

Kindly ensure once whether you provided the same id and text field as same as the initial mapping.  

Output image 

 


Please check the above sample and get back to us if you need any further assistance. 

Regards, 
Kanagambigai 



MikeR
Replied On July 24, 2019 09:35 PM UTC

Hi Mike, 

Greetings from Syncfusion. 

You can dynamically add the tree nodes via AddNodes method using the following code snippet. 

public void addNodes() 
{ 
     List<object> listdata = new List<object>(); 
     listdata.Add(new 
        { 
            employeeID = this.index, 
            firstName = "NewItem", 
        }); 
         this.tree.AddNodes(listdata); 
         this.index = this.index + 1; 
} 

 

Kindly ensure once whether you provided the same id and text field as same as the initial mapping.  

Output image 

 


Please check the above sample and get back to us if you need any further assistance. 

Regards, 
Kanagambigai 



Thanks this was what I needed.
/Miker

Kanagambigai Murugan [Syncfusion]
Replied On July 25, 2019 04:53 AM UTC

Hi Mike, 

Thanks for the update. 

We are glad to hear that the provided solution has worked as expected. Please get back to us if you need any further assistance. We would be happy to assist you. 

Regards, 
Kanagambigai M. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon