|
Prev: copy from one listbox to another...
Next: job vermittlung ausland jobboerse hamburg Controller Controllerin job ausland
From: jp2msft on 8 Jul 2008 18:17 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 SelectedNodeChanged 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
From: kimiraikkonen on 9 Jul 2008 18:33 On Jul 9, 1:17 am, jp2msft <jp2m...(a)discussions.microsoft.com> wrote: > 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 SelectedNodeChanged 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_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect MsgBox("worked!") End Sub ..which works even when a root or child node is selected. Plus, there's no an event called "SelectedNodeChanged" 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 "SelectedNodeChanged" event maybe due to using VB 2005 express instead of Visual Web Developer. Plus, you can check this out for usage: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.selectednodechanged.aspx Hope this helps, Onur Güzel
From: jp2msft on 10 Jul 2008 09:15
Interesting. You are right! It is working today. Perhaps I had a bug in the system yesterday. Sorry for the confusion. "kimiraikkonen" 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_AfterSelect(ByVal sender As System.Object, ByVal > e As System.Windows.Forms.TreeViewEventArgs) Handles > TreeView1.AfterSelect > MsgBox("worked!") > End Sub > > ..which works even when a root or child node is selected. > > Plus, there's no an event called "SelectedNodeChanged" 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 > "SelectedNodeChanged" event maybe due to using VB 2005 express instead > of Visual Web Developer. > > Plus, you can check this out for usage: > http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.selectednodechanged.aspx > > Hope this helps, > > Onur Güzel > |