TreeView - Selecting Multiple Nodes

T

Tim Rogers

Is there a way to allow selection of multiple nodes in a TreeView control?
I suppose I might want two ways to select multiple nodes: 1) with a mouse
drag, highlighting multiple nodes 2) Using a combination of Ctrl and Shift
key presses to select multiple nodes (like in Windows Explorer). For what
it's worth, I'm only concerned with selecting multiple sibling nodes (i.e.
groups of nodes under a single parent node).

I don't see anything in the TreeView API that would appear me to select
multiple nodes. Is this possible? If so, any suggestions on how to
implement would be much appreciated.

Thanks,

Tim Rogers
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Tim,

The TreeView control is indeed limited to selecting only a single node. You
may search the Code Project web site for an article and a code sample where
this control is customized to implement an ability to select multiple nodes.
 
J

Joe White

The Microsoft treeview does not support multi-select. You'll have to
either use a third-party treeview control, or use a ListView and set the
items' Indent property (which will get you the tree structure, but not
the ability to expand/collapse).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top