[CLOSED] HOW TO select a TreeNode of a TreePanel in code-behind - EXT.NET 2.4.x

  1. #1

    [CLOSED] HOW TO select a TreeNode of a TreePanel in code-behind - EXT.NET 2.4.x

    Hello,
    I'm using EXT.NET 2.4.0.28408 and i'm building a tree in vb code-behind.

    Here's the ext tree panel:
         <ext:TreePanel ID="charTree" runat="server" Width="300"             
            Height="550" 
            Icon="BookOpen" 
            Title="Elements" 
            AutoScroll="true">
             <Root>
             </Root>
            <BottomBar>
                <ext:StatusBar ID="StatusBar1" runat="server" AutoClear="1500" />
            </BottomBar>
            <Listeners>                    
                <ItemClick 
                    Handler="#{StatusBar1}.setStatus({text: 'Selected Node: <b>' + record.data.text + '<br />', clear: false});"
                    />
                <ItemExpand 
                    Handler="#{StatusBar1}.setStatus({text: 'Expanded Node: <b>' + item.data.text + '<br />', clear: false});" 
                    Buffer="30"
                    />
                <ItemCollapse 
                    Handler="#{StatusBar1}.setStatus({text: 'Collapsed Node: <b>' + item.data.text + '<br />', clear: false});" 
                    Buffer="30"
                    />
            </Listeners>
        </ext:TreePanel>
    Here's the code-behind in vb.net:
    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim root As New Ext.Net.Node
        Dim children As String() = {"a", "b", "c"}
     
        root.Text = "Alphabet"
        charTree.Root.Add(root)
     
        For Each c As String In children.ToList
            Dim node As New Ext.Net.Node
            node.Text = c
            node.Icon = Icon.Add
            node.Leaf = True
            root.Children.Add(node)
        Next
    End Sub
    The problem is that I'm trying to select a node in this tree panel, for example node with assigned text "b", and, simply, I'm not able to do it: how to?!?

    Thank you in advance.
    Last edited by Daniil; Apr 09, 2014 at 2:37 AM. Reason: [CLOSED]
  2. #2
    Hi @PoloTheMonk,

    I would use a TreeSelectionModel's SelectedRows.
  3. #3
    Hi Daniil,

    could you please provide an example or a link to the use?

    Cheers
  4. #4
    Similar to this:
    http://examples2.ext.net/#/GridPanel...Row_Selection/

    Please see Page_Load.
    Last edited by Daniil; Apr 09, 2014 at 2:37 AM.

Similar Threads

  1. [CLOSED] How can I select a TreeNode using JavaScript code
    By gets_gui in forum 2.x Premium Help
    Replies: 1
    Last Post: Oct 18, 2012, 11:05 PM
  2. [CLOSED] Treenode link and select
    By xeo4.it in forum 1.x Premium Help
    Replies: 6
    Last Post: Jan 17, 2011, 9:33 AM
  3. [CLOSED] [1.0] How to select a treenode in codebehind?
    By klaus.schwarz in forum 1.x Premium Help
    Replies: 2
    Last Post: Nov 01, 2010, 4:00 PM
  4. Replies: 0
    Last Post: Dec 10, 2009, 12:14 PM
  5. How to select TreeNode with Up/Down keys?
    By dbassett74 in forum 1.x Help
    Replies: 0
    Last Post: May 26, 2009, 8:23 PM

Posting Permissions