FindNodeByText - Couple of Questions

2 posts, 0 answers
  1. Silver
    Silver avatar
    25 posts
    Member since:
    Feb 2012

    Posted 21 May 2012 Link to this post


    I provided a textbox for user to find tree view nodes. The find functionality is working good, but I have couple of questions

    1. After node.expand() and, how to make the tree view to load a page which is tied to that node. Each node on my tree view has NavigateURL set to a aspx page.

    2. Is there a way to find the node based on partial value entered? For example if node text is 'Employee Engagements', I want to find the node if user enters 'Employee' or 'Engagements'.. I mean like text.contains..

  2. Plamen
    Plamen avatar
    3036 posts

    Posted 24 May 2012 Link to this post

    Hello Silver,

    1.You can navigate to the URL of some node as it is done in this code:

    function OnClient(sender, args) {
              var treeOne = $find("<%= RadTreeView1.ClientID %>");
    2.Here is that code  that shows how to go through all the nodes and select all the files that contain some text:
    function OnClientClicked(sender, args) {
                  var textBox = $find("<%= RadTextBox1.ClientID %>");
                 var treeOne = $find("<%= RadTreeView1.ClientID %>");
                  for (var i = 0; i < treeOne.get_allNodes().length; i++) {
                        if (treeOne.get_allNodes()[i].get_text().indexOf(textBox.get_value()) !=-1) {
            <telerik:RadTextBox runat="server" ID="RadTextBox1">
             <telerik:RadButton runat="server" ID="RadButton1" AutoPostBack="false" Text="Select Nodes"
           <telerik:RadButton runat="server" ID="RadButton2" AutoPostBack="false" Text="Navigate"
            <telerik:RadTreeView runat="server" ID="RadTreeView1" MultipleSelect="true">...

    Hope this will help you.

    All the best,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top