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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Anchoring the Treeview

Thread ID:





78999 Jan 15,2009 08:23 PM UTC May 20,2009 08:19 PM UTC ASP.NET Web Forms (Classic) 4
Tags: Tools
Daniel Santos de Carvalho
Asked On January 15, 2009 08:23 PM UTC

I would like some help with the treeview component.

When i load a page with the treeview, it is loaded with many nodes so that it show a scroll, when i scroll down the component and click a node name, it reloads the page and show the a new form on the side other side of the page. The problem is that i wanted that when the page is loaded back, the treeview scroll down dynamically on the node that i have clicked, like an anchoring point to my treeview, so that i don't have to scroll down again and look the place that i have clicked on the treeview.

Rekha P [Syncfusion]
Replied On January 16, 2009 07:41 AM UTC

Hi Daniel,

Thank you for your interest in Syncfusion Products.

The scrollbar position can be made to the selected TreeViewNode using one of the next code snippets in your coding.

//server side
protected void Page_Load(object sender, EventArgs e)

//client side

Also please refer the sample below which illustrates the scrollbar position to the selected TreeViewNode.


Please let me know if this sample helps.


Daniel Santos de Carvalho
Replied On January 16, 2009 01:44 PM UTC

Hi Rekha,

The example shows what i want, but it is not working for me.

My treeview don't has the "EnsureVisibleItem" method neither it is implemented in the code of the example.

I'm recording the selected node into the session and in the page load, i retreat it and use the code:

this.TreeView1.SelectedNode = node;

but the scroll goes back anyway.

Rekha P [Syncfusion]
Replied On January 19, 2009 12:27 PM UTC

Hi Daniel,

The EnsureVisibleItem() is added in our latest versions and please refer the forum thread below for download our Essential Studio 2009 Volume1.


Please let us know if you have any other concerns.


Administrator [Syncfusion]
Replied On May 20, 2009 08:19 PM UTC

I have a TreeView control bind to an object data source. I have a problem to cast the selected not the object in the data source. I know that the TreeViewNode allows to get the selected node, but that doesn't expose the properties of the object in the data source. These are the objects in the data source.
InfluencerDomainEntity objDomain = new InfluencerDomainEntity("Region");
objDomain.DomainId = 2;
objDomain.ParentId = 0;
objDomain.DomainFriendlyName = "Name of the Region";

InfluencerDomainEntity objDomain1 = new InfluencerDomainEntity("LATAM");
objDomain1.DomainId = 3;
objDomain1.ParentId = 2;
objDomain1.DomainFriendlyName = "LATAM";
InfluencerDomainEntity objDomain2 = new InfluencerDomainEntity("USA");
objDomain2.DomainId = 4;
objDomain2.ParentId = 3;
objDomain2.DomainFriendlyName = "USA";
How can I get selected object with all its properties?


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