|
-
May 15th, 2009, 11:22 AM
#3
Re: Populate TreeView with Active Directory objects
I dont understand the first question, the custom TreeNode class I wrote/displayed in the above posts provides a property named DistinguishedName so you just access that property on the selected node... can you provide an example of what exactly you are trying to do and maybe I can show you how to go about it?
As for the second question, you could do that but it would require you to re-work the code I've provided because my code just adds all of the nodes to a single parent node that is stored in memory and then when that has all finished it just adds that parent node to the treeview, so you would have to change it so that instead of adding it to a node in memory it adds it to the actual treeview on screen and because that recursive function is running in a background thread that would mean you need to create another delegate etc to handle the cross thread call. Basically, I'm sure it could be done but personally I dont think its worth the hassle as it doesnt take very long (on the domains I tested it on anyway) to build the tree and its not as if the UI freezes while its being built or anything so there's little advantage to doing it.
EDIT: Take a look at this thread on how to build a treeview node list in a background thread: http://www.vbforums.com/showthread.php?t=570020
Last edited by chris128; May 20th, 2009 at 03:14 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|