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
close icon

Anchoring the Treeview

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.


4 Replies

RP Rekha P Syncfusion Team 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)
{
TreeView1.EnsureVisibleItem();
}


//client side


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

http://websamples.syncfusion.com/samples/Tools.Web/6.4.0.15/F78999_TreeView/main.htm

Please let me know if this sample helps.

Thanks,
Rekha



DS Daniel Santos de Carvalho 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.



RP Rekha P Syncfusion Team 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.

http://www.syncfusion.com/support/forums/message.aspx?MessageID=79036

Please let us know if you have any other concerns.

Thanks,
Rekha



AD Administrator Syncfusion Team 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?
Thanks,
Leul

Loader.
Live Chat Icon For mobile
Up arrow icon