Treeview- programatically select a Node

L

Liliana García

Hi:

How could I select programatically a specific Node in a Treeview?

Thanks,

Liliana
 
T

Teemu Keiski

Either looping through nodes (if you don't know index of the node and you
need to pick up the node say by data in it NodeData attribute). If you know
the index, you could say TreeView's GetNodeFromIndex method.

About looping there are examples:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=263416
(See the IE WebControls forum generally)

--
Teemu Keiski
MCP,Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 
L

Liliana García

Hi:

Thanks for your time. I know the index of the node. My question is, once I
have this index, how can I do to make this node, the selected node in the
Treeview.

Regards,

Liliana
 
A

Alvin Bruney

You have to loop thru the node collection if it is built dynamically if not
treenode.nodes[0].node[index] will give you what you want
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top