TreeView leaf node click event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lyle Griess
    New Member
    • Sep 2010
    • 2

    TreeView leaf node click event

    TreeView? which one should I choose? Help I'm having difficulty getting click and double-click events to work (or even find events for them) in the leaf nodes of the TreeView (any component).. Bill Gates and his burglars need to steal a better piece of code.
  • Anton Zinchenko
    New Member
    • Sep 2010
    • 16

    #2
    What about NodeMouseClick and NodeMouseDouble Click events?

    Code:
            private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
            {
                if (e.Node.Parent == null)
                {
                    MessageBox.Show("Root node");
                }
                else
                {
                    MessageBox.Show(e.Node.Text);
                }
            }

    Comment

    • Lyle Griess
      New Member
      • Sep 2010
      • 2

      #3
      How do I know which TreeView object this code goes with? I have been coding on the <asp:TreeView object
      using System.Web.UI.W ebControls;

      Comment

      Working...