This is a migrated thread and some comments may be shown as answers.

RadTreeView refreshes to top of tree NodeExpand

2 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 14 Sep 2011, 10:15 AM
Hi

We have a RadTreeView registered as below:

<radT:RadTreeView ID="cRadTreeView" EnableViewState="true" style="Z-INDEX:999" Runat="server" BeforeClientClick="BeforeClickHandler"
	Checkboxes="true" DragAndDrop="true"></radT:RadTreeView>


I've been trying to put a fix in place to stop the tree refreshing back to the top after a Node has expanded. I am registering the NodeExpand event in the OnInit of the page and that event carries out the following code, is there a way for the tree to switch focus to the node that was previously expanded?


Guid expandedNodeID = new Guid(e.NodeClicked.Value);
			this.DataSource.ExpandNode(expandedNodeID);
			RadTreeNode node = this.GetTree(this.DataSource[expandedNodeID]);
			if(node.Nodes.Count > 0)
			{
				foreach(RadTreeNode child in node.Nodes)
				{
					e.NodeClicked.AddNode(child);
				}
			}
			e.NodeClicked.ExpandMode = ExpandMode.ClientSide;

2 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 14 Sep 2011, 03:55 PM
I have found the issue is caused by not having a height property set to the RadTreeView.

I have tried the below code but this is failing to apply the Height property to the RadTreeView. I am wanting to apply the height property to the RadTreeView based on the height of the RadWindow as a user will likely resize this window and having a static height would make the tree cut off after the desired height.

window.setTimeout(ResizeRadTree(), 100);
 
	function ResizeRadTree()
	{
		$('cRadTreeView').height(GetRadWindow().Height)
	}
0
Plamen
Telerik team
answered on 16 Sep 2011, 10:59 AM
Hello Jonathan,

You can refer to this forum post - Make RadTreeView occupy 100% of the Window height.

Hope this will help.

Regards,
Plamen Zdravkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
TreeView
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or