Wrox Programmer Forums
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 26th, 2008, 04:15 PM
Authorized User
 
Join Date: Jun 2008
Posts: 75
Thanks: 15
Thanked 0 Times in 0 Posts
Default Tree View

I have a tree view control where I don't want anything to happen unless the user selects a LeafNode. In other words the only time I want the TreeView1_SelectedNodeChanged to fire is if the user selects a LeafNode. Any suggestions or referrals to resources is greatly appreciated.



 
Old November 26th, 2008, 05:05 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Protected Sub TreeView1_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
    Handles TreeView1.SelectedNodeChanged

    Dim clickedNode As TreeNode = TreeView1.SelectedNode
    If clickedNode.ChildNodes.Count = 0 Then

        'a leafnode was clicked, so do your thing here

    End If

End Sub

_________________________________

Visit my blog at http://leedumond.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tree view control g_vamsi_krish ASP.NET 1.0 and 1.1 Basics 2 April 4th, 2006 11:02 PM
Tree View mistry_bhavin ASP.NET 1.x and 2.0 Application Design 1 August 3rd, 2005 03:58 PM
help me on tree view gps_giri_p General .NET 0 December 13th, 2004 10:36 AM
tree view msrnivas .NET Web Services 0 February 23rd, 2004 07:04 AM
Tree View Natalie Pro VB 6 5 September 23rd, 2003 07:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.