Click here to Skip to main content
13,404,713 members (35,633 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a treeview in winwoforms. It has one root and four child nodes.
Using mouseclick event, I need to take index of the selected node but the problem with me is, it displays the index of root node only, even if I click root node or any of the child node, it display index as 0

I want to identify if user clicked the root node or child node.

Please advise.
Posted 8-Jan-13 22:44pm
Sandeep Mewara 9-Jan-13 4:04am
You should have shared your related code snippet that is troubling you.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

As far as I know, the TreeView class has no selected index property.
If you need the SelectedNode reference, you may handle the AfterSelect event.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.1802120.2 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100