TreeView and TreeNodes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?anAybXNmdA==?=

    TreeView and TreeNodes

    My first time using a TreeView:

    I've got a TreeView that I populated with some data and it has nodes.

    In the Properties window, I created an Event Handler for the TreeView's
    AfterSelect method, and it allows me to determine what Tree Node has been
    selected.

    However, if I expand the TreeView and select one of the Child TreeNodes,
    they do not trigger this event.

    My local help says to use the SelectedNodeCha nged Event, but I do not see
    that in the Properties window.

    How is the best way to handle whenever an item in my TreeView is selected
    (including the TreeView TreeNodes)?

    Thanks,
    Joe

  • kimiraikkonen

    #2
    Re: TreeView and TreeNodes

    On Jul 9, 1:17 am, jp2msft <jp2m...@discus sions.microsoft .comwrote:
    My first time using a TreeView:
    >
    I've got a TreeView that I populated with some data and it has nodes.
    >
    In the Properties window, I created an Event Handler for the TreeView's
    AfterSelect method, and it allows me to determine what Tree Node has been
    selected.
    >
    However, if I expand the TreeView and select one of the Child TreeNodes,
    they do not trigger this event.
    >
    My local help says to use the SelectedNodeCha nged Event, but I do not see
    that in the Properties window.
    >
    How is the best way to handle whenever an item in my TreeView is selected
    (including the TreeView TreeNodes)?
    >
    Thanks,
    Joe
    As i understood, you created an AfterSelect event for TreeView
    control, i couldn't reproduce the problem about triggering AfterSelect
    event, here it is:

    Private Sub TreeView1_After Select(ByVal sender As System.Object, ByVal
    e As System.Windows. Forms.TreeViewE ventArgs) Handles
    TreeView1.After Select
    MsgBox("worked! ")
    End Sub

    ..which works even when a root or child node is selected.

    Plus, there's no an event called "SelectedNodeCh anged" for TreeView as
    i'm using .NET 2.0 for "Winforms", based on my search it's available
    for ASP.NET web controls and though i referenced System.Web.dll and
    imported "System.Web.UI. WebControls" still i'm unable to get
    "SelectedNodeCh anged" event maybe due to using VB 2005 express instead
    of Visual Web Developer.

    Plus, you can check this out for usage:


    Hope this helps,

    Onur Güzel

    Comment

    • =?Utf-8?B?anAybXNmdA==?=

      #3
      Re: TreeView and TreeNodes

      Interesting. You are right! It is working today.

      Perhaps I had a bug in the system yesterday. Sorry for the confusion.

      "kimiraikko nen" wrote:
      As i understood, you created an AfterSelect event for TreeView
      control, i couldn't reproduce the problem about triggering AfterSelect
      event, here it is:
      >
      Private Sub TreeView1_After Select(ByVal sender As System.Object, ByVal
      e As System.Windows. Forms.TreeViewE ventArgs) Handles
      TreeView1.After Select
      MsgBox("worked! ")
      End Sub
      >
      ..which works even when a root or child node is selected.
      >
      Plus, there's no an event called "SelectedNodeCh anged" for TreeView as
      i'm using .NET 2.0 for "Winforms", based on my search it's available
      for ASP.NET web controls and though i referenced System.Web.dll and
      imported "System.Web.UI. WebControls" still i'm unable to get
      "SelectedNodeCh anged" event maybe due to using VB 2005 express instead
      of Visual Web Developer.
      >
      Plus, you can check this out for usage:

      >
      Hope this helps,
      >
      Onur Güzel
      >

      Comment

      Working...