How to determine TreeView SelectedNode relative position

Discussion in 'ASP .Net Web Controls' started by pardesiya, May 11, 2007.

  1. pardesiya

    pardesiya Guest

    Hello Folks,

    I have an asp TreeView which I populate at runtime. When I click on a
    node, I want to know what is the position of the selected node under
    it's parent (i.e. position relative to it's siblings).

    I tried MyTreeView.SelectedNode.Index but get the error:
    'System.Web.UI.WebControls.TreeNode' does not contain a definition for
    'Index'

    Much appreciate any help
    pd
     
    pardesiya, May 11, 2007
    #1
    1. Advertising

  2. pardesiya

    pardesiya Guest

    Ok got it!

    int iIndex =
    MyTreeView.SelectedNode.Parent.ChildNodes.IndexOf(MyTreeView.SelectedNode);
     
    pardesiya, May 11, 2007
    #2
    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. =?Utf-8?B?anlvdGkgcmFuamFu?=

    treeview selectednode

    =?Utf-8?B?anlvdGkgcmFuamFu?=, May 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,426
    avnrao
    May 6, 2004
  2. mike uk
    Replies:
    2
    Views:
    3,506
    mike uk
    Nov 19, 2005
  3. Luqman
    Replies:
    1
    Views:
    657
    Luqman
    Feb 7, 2006
  4. Jared
    Replies:
    0
    Views:
    6,456
    Jared
    May 29, 2006
  5. Replies:
    0
    Views:
    99
Loading...

Share This Page