Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tree view control
Message
From
02/05/2005 19:40:29
 
 
To
02/05/2005 15:05:41
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01010269
Message ID:
01010346
Views:
23
Paul,

I'm not sure why you're having a problem with #1. I have successfully checked all child nodes without expanding. I'm using C#, but I wouldn't think that there's a difference in functionality there between C# and VB (I could be wrong).

As far as #2 goes, unfortunately, I think you will have to "walk the tree" to find the checked Nodes. I suggest sub-classing the TreeView control and creating a CheckedNodes collection. Shouldn't be too difficult to implement.

~~Bonnie

>I am working on a treeview control with check boxs to display Folders and Files for an FTP program to use as its selection and have 2 problems.
>
>1.) I want to be able to check all child nodes when a parent node is checked, however using the code below I must expand all nodes to get it to work. So the code below works but isnt very appealing.
>
>  Private Sub DirectoryTreeView_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles MyBase.AfterCheck
>
>            ' for some reason I have to Expand all child nodes to get them checked
>            e.Node.ExpandAll()
>            Dim onode As TreeNode
>            For Each onode In e.Node.Nodes
>                onode.Checked = True
>            Next
>        End If
>
>
>
>2) Is there a method to tell what has been checked similar to the checked list box? I would hate to have to loop through the entire treeview to check for checked :)
>
>I appreciate any help
>
>Paul
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform