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

scroll the page to the selected node

1 Answer 73 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Mehrdad
Top achievements
Rank 1
Mehrdad asked on 10 Mar 2009, 10:46 AM
Hi,
I have a treeview on my page and I have a clientside search on it.
My tree height is longer that the page, now if a node be found on bottom of page and I select it, now how can I scroll the page to appear the slected node

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Mar 2009, 01:28 PM
Hi Mehrdad,

One suggestion is by setting the height of the RadTreeView so that scrollbars for RadTreeview will appear and using the following client sde code for scrolling to the selected node.

JavaScript:
<script type="text/javascript">  
function find()  
{  
   var tree= $find("<%= RadTreeView1.ClientID %>");  
   var Node = tree._findItemByText("FindMe"); // Get the node  
   if (Node != null)  
   {  
     Node.select();  //Select the node  
     Node.scrollIntoView(); // Scroll to the selected node  
   }  
}  
</script> 

Thanks,
Princy.
Tags
TreeView
Asked by
Mehrdad
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or