﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Lounge - Node Expand Event</title><link>http://www.intersoftsolutions.com/Community/Lounge/Node-Expand-Event/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Node Expand Event</title><link>http://www.intersoftsolutions.com/Community/Lounge/Node-Expand-Event/</link><pubDate>Tue, 17 May 2016 15:03:09 GMT</pubDate><dc:creator>shailendra.senger</dc:creator><category>WebTreeView</category><description>Ideally your solution should work but unfortunately it is not. When you searched a node full post-back occurs which again resets the scroll position on top. ScrollIntoView() function only works if it is being called when searched node's parents(or say immediate parent ) expands.Please remember my application requires treeview to bind it at runtime from code behind and also using full postback. </description></item><item><title>Node Expand Event</title><link>http://www.intersoftsolutions.com/Community/Lounge/Node-Expand-Event/</link><pubDate>Tue, 17 May 2016 08:03:37 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebTreeView</category><description>&lt;blockquote&gt;&lt;p&gt;... This solution fails in a situation where searched node's grand parent is collapsed but its childrens are expanded. ...&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Please check out the snippet of JS function below.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;function FindNextNode()
{
    var tv = ISGetObject("WebTreeView1");
    var searchText = document.getElementById("txtSearch").value;
    if(searchText != "")
    {
        var node = tv.FindNextNodeByText(searchText);
        if (node != null)
        {                
            //node.Select();
            node.ExpandHierarchyAndSelect();
            node.GetElement().scrollIntoView();                
        }
        else
            alert("The search text can't be found");
    }
    else
        alert("Please fill in the search text");
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I use this JS function to search WebTreeViewNode by text. &lt;strong&gt;ExpandHierarchyAndSelect()&lt;/strong&gt; is called instead of invoking the &lt;strong&gt;Select()&lt;/strong&gt; method. This method, &lt;strong&gt;ExpandHierarchyAndSelect()&lt;/strong&gt;, will expands and selects nodes in a hierarchy.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;After hierarchy is expanded and node get selected, invoke scrollIntoView() to scrolls the selected node element into the visible area of the browser window.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;This should helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Node Expand Event</title><link>http://www.intersoftsolutions.com/Community/Lounge/Node-Expand-Event/</link><pubDate>Mon, 16 May 2016 21:48:11 GMT</pubDate><dc:creator>shailendra.senger</dc:creator><category>WebTreeView</category><description>&lt;p&gt;I am binding treeview at runtime by processing a List&amp;lt;T&amp;gt; appropriatly as a datasource where T is a class. Since&amp;nbsp;&lt;span style="font-size: 10pt;"&gt;Treeview doesn't have any inbuilt function which can make the searched node visibile to user. If treeview has large number of nodes than searching a bottom node always resides in bottom and scroll bar doesn't set appropriatly to bring that node up. However I got a work around to call ScrollIntoView() function, for searched node, on node expand event. This solution fails in a situation where searched node's grand parent is collapsed but its childrens are expanded. &amp;nbsp;So when a grandparent expanded, its OnNodeExpand event fires for it only, not for its children as they already expanded.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Please let me know how can I trigger&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 13.3333px;"&gt;OnNodeExpand&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;event for all children nodes as well (no matter if they&amp;nbsp;already expanded).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>