TreeView - Selecting Multiple Nodes

  • Thread starter Thread starter Tim Rogers
  • Start date Start date
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
 
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.
 
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).
 
Back
Top