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.
Unfortunately, activation email could not send to your email. Please try again.

Anchoring the Treeview

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 02:41 AM

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


Daniel Santos de Carvalho
Replied On January 16, 2009 08:44 AM

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 07:27 AM

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


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

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

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.

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.

;