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

[Solved] Trying to use radTreeNode.Scrollintoview() and failing

1 Answer 139 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jeff Rasmussen
Top achievements
Rank 1
Jeff Rasmussen asked on 09 Mar 2010, 10:48 PM

I'm having a bit of trouble using the scrollIntoView() function of radtreenode and i think the problem is because the tree lives in a sliderpane.

I've also tried to use the SliderPane.scrollIntoView(object) by crawling up to the parent level (.parentNode.parentNode...), and invoking from there.
but keep getting "Type Mismatch", i think because this method does not accept a radtreenode as the target element.

 

 


I'm not sure what to do next.

Any ideas?

Thanks everyone for your help.

 

 

 

 

 

 

 

 

 

function rtvSurvey_ClientLoad(sender, eventArgs)   
{  
 var selectedNode = sender.get_selectedNode();  
 if (selectedNode)   
 {  
  selectedNode.scrollIntoView();  
 }  
}   
 

 

<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="800px" Width="100%" HeightOffset="3"    
        LiveResize="True">     
         <telerik:RadPane ID="RadPane1" runat="server" Scrolling="X" Width="22" Height="100%">     
            <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" ClickToOpen="false" DockedPaneId="RadSlidingPane1"    
                Height="100%" Width="22">     
                <telerik:RadSlidingPane ID="RadSlidingPane1" runat="server" BorderStyle="Solid" BorderWidth="3px"    
                    DockOnOpen="true" EnableEmbeddedBaseStylesheet="False" Height="100%" Title="My Title Goes Here"    
                    Width="300px">     
                    <telerik:RadTreeView ID="RadTreeView1" OnClientLoad="RadTreeView1_ClientLoad" runat="server" EnableDragAndDrop="False" EnableDragAndDropBetweenNodes="False"    
                        EnableViewState="true" OnClientContextMenuItemClicking="onClientContextMenuItemClicking"    
                        OnClientContextMenuShowing="onClientContextMenuShowing" OnClientNodeClicking="ClientNodeClicking"    
                        Visible="true" ShowLineImages="False">   
 

 

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 12 Mar 2010, 01:33 PM
Hi Jeff Rasmussen,

I've made a sample solution for you. You don't need to use the SliderPane.scrollIntoView(object). Just do the same logic as if RadTreeView is not in a RadSlidingPane.

In my example the whole TreeView is scrolled to the previously selected node:

function pageLoad() {
            var tree = $find("<%= RadTreeView1.ClientID %>");
            var selectedNode = tree.get_selectedNode();
            if (selectedNode != null) {
                window.setTimeout(function() { selectedNode.scrollIntoView(); }, 200);
            }
        }

<telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2" Selected="true">
                                        </telerik:RadTreeNode>

You may find the full code in the attached .zip file.

Please let me know if this was helpful.
 
Greetings,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Jeff Rasmussen
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or