Posted on Sep 29, 2009 (permalink)
Reply
Posted on Sep 30, 2009 (permalink)
Hi Peter, I have another question related to this topic now. Along with being able to search for a node by text, the user has the ability to select a node by clicking it. The issue I am encountering now is that if the user clicks a node after searching for a node, the javascript will scroll the node just clicked by the user to the top. In the FindNode method is there a way to call the javascript function to scroll to the node found by the search without setting the text property of the Label equal to the javascript function name? I tried setting the Label14.Text = "" in the Select_NodeClick method, but the node was still scrolled to the top. OR Is there a way to pass the node text to the javascript function to get the node by text instead of using get_selectedNode? My code is below: TreeView Definition:
Code Behind:
Javascript:
Posted on Oct 5, 2009 (permalink)
Posted on Oct 6, 2009 (permalink)
Posted on Feb 18, 2011 (permalink)
function pageLoad() {
var tree = $find("<%= tvwAssetHierarchy.ClientID %>");
if (tree != null) {
var selectedNode = tree.get_selectedNode()
if (selectedNode != null) {
window.setTimeout(
function() { selectedNode.scrollIntoView(); }, 480);
}}} But now what i want the user is checking the last node i want to Scrollintoview for the last checked node is it possible? is there any method in the radtreeview which can give me the last checkednode or do i need to store it during the onclientradtreenodecheching event into a session variable and get that on the pageLoad event of the radtreeview. Please suggest me on this.
Posted on Feb 21, 2011 (permalink)
Posted on Apr 12, 2011 (permalink)
Posted on Apr 18, 2011 (permalink)
<script type=
"text/javascript"
>
function
OnClientNodeExpanded(sender, args) {
var
treeview = sender;
node = treeview.findNodeByValue(
"this"
)
setTimeout(
() { scrollToNode(treeview, node); }, 500);
}
scrollToNode(treeview, node) {
nodeElement = node.get_contentElement();
treeViewElement = treeview.get_element();
nodeOffsetTop = treeview._getTotalOffsetTop(nodeElement);
treeOffsetTop = treeview._getTotalOffsetTop(treeViewElement);
relativeOffsetTop = nodeOffsetTop - treeOffsetTop;
treeViewElement.scrollTop = relativeOffsetTop;
</script>
<telerik:RadTreeView ID=
"RadTreeView1"
Width=
"200px"
Height=
"300px"
runat=
"server"
OnClientNodeExpanded=
"OnClientNodeExpanded"
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.
Posted on Apr 20, 2011 (permalink)
Posted on Jul 4, 2011 (permalink)
Posted on Jan 25, 2012 (permalink)
Posted on Jan 30, 2012 (permalink)
Back to Top
[ ASP.NET TreeView Features | Documentation | Demos | Telerik TV | Self-Paced Trainer | Step-by-step Tutorial ]
UI controls for ASP.NET AJAX, MVC, WPF, Silverlight, Windows Forms and Windows Phone. Visual Studio productivity tools. Reporting and data layer solutions.
HTML5 / JavaScript tools for Web and Mobile applications
Functional, Performance, Load and Mobile Software Testing
CMS, Mobile Web, Ecommerce, Emarketing, Social Media
Project management software inspired by Agile best practices
It seems you haven't bookmarked any pages. Fix that by clicking the button below