Treeview Web Control - selecting a node

Discussion in 'ASP .Net Web Controls' started by Rod Early, Dec 8, 2003.

  1. Rod Early

    Rod Early Guest

    Does anyone know how to programmatically select a tree node, either
    with code or in the XML file supplied to the treeview control.

    I can expand it by setting the EXPANDED attribute in the TreeNode
    elements in XML. But I can't figure out how to select a particular
    node even after it has been expanded to.

    Thanks,
    Rod Early
     
    Rod Early, Dec 8, 2003
    #1
    1. Advertising

  2. Rod Early

    Guest Guest

    just set TreeView1.SelectedNodeIndex equals to the index
    of the node with you want to select.
    >-----Original Message-----
    >Does anyone know how to programmatically select a tree

    node, either
    >with code or in the XML file supplied to the treeview

    control.
    >
    >I can expand it by setting the EXPANDED attribute in the

    TreeNode
    >elements in XML. But I can't figure out how to select a

    particular
    >node even after it has been expanded to.
    >
    >Thanks,
    >Rod Early
    >.
    >
     
    Guest, Dec 15, 2003
    #2
    1. Advertising

  3. Rod Early

    Rod Early Guest

    Thank you. I had been thinking that I could select a TreeNode element
    in the same way that a dropdown listbox list element can be given a
    SELECTED attribute. But as you say, it has to be set at runtime via
    the SelectedNodeIndex property.

    Thanks,
    Rod Early

    <> wrote in message news:<01fb01c3c2ab$bc162570$>...
    > just set TreeView1.SelectedNodeIndex equals to the index
    > of the node with you want to select.
    > >-----Original Message-----
    > >Does anyone know how to programmatically select a tree

    > node, either
    > >with code or in the XML file supplied to the treeview

    > control.
    > >
    > >I can expand it by setting the EXPANDED attribute in the

    > TreeNode
    > >elements in XML. But I can't figure out how to select a

    > particular
    > >node even after it has been expanded to.
    > >
    > >Thanks,
    > >Rod Early
    > >.
    > >
     
    Rod Early, Dec 15, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,470
  2. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,490
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  3. Tjerk Wolterink
    Replies:
    2
    Views:
    1,440
    Dimitre Novatchev
    Aug 24, 2006
  4. dhurwitz

    Programmatically selecting a node in a TreeView

    dhurwitz, Jun 13, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    206
    dhurwitz
    Jun 13, 2006
  5. chris

    Selecting Treeview node causes repaint - sometimes

    chris, Jul 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    137
    chris
    Jul 8, 2006
Loading...

Share This Page