|
-
Nov 5th, 2014, 02:01 PM
#1
Thread Starter
Member
MultiSelect Treeview
How to select one or more nodes using the treeview?
Att
Joel Vieira
-
Nov 5th, 2014, 03:45 PM
#2
Re: MultiSelect Treeview
With the standard .net treeview, you can't. I suspect it would not be very difficult to create the effect though....
Create a class level List(of Treenode) to hold to selected nodes collection,
If a node is clicked, check the control key using the Control.ModifierKeys property,
If control is not pressed, clear the selected nodes
If the control key is pressed, add the node to the selected nodes collection
Finally, handle the treeviews drawNode event and if the node being drawn is in the collection, draw it so it looks selected using the SystemColors.Highlight Property.
Also if you wanted to perform and action of the entire selection, (such as delete, copy, etc) you would perform the action to everything in the selected node collection.
I have only highlighted a method that could work, and I'm sure there are a number of details I did not mention, but if you give it a go, I'm sure there are people to help if you get stuck
kevin
Last edited by kebo; Nov 5th, 2014 at 05:59 PM.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
Nov 6th, 2014, 12:56 PM
#3
Re: MultiSelect Treeview
I use objectlistview ... this has a treeview that supports columns and multi-select ... but it may be a little complex for a n00b... still worth the look though
Kris
Tags for this Thread
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
|