Click here to Skip to main content
12,502,104 members (52,329 online)
Click here to Skip to main content
Add your own
alternative version

Stats

166.9K views
4.4K downloads
46 bookmarked
Posted

Multi-select Treeview control v2.0

, 15 Aug 2004
Rate this:
Please Sign up or sign in to vote.
Multi-select Treeview control v2.0

Screenshots

Introduction

This is a multi select TreeView Control for the .NET framework. It is possible to select TreeNodes in multiple ways with or without constraints.

Details

The MWTreeView has a few ways of mouse-selecting the TreeNodes by painting anything from a rubberband to very graphical representations. There is even the possibility, using GDI+, to customize the mouse-selection. It is also possible to have TreeNodes of various colors within the same MWTreeView with multi-selection still working. The MWTreeView has a massive amount of configurable settings so that anyone should be able to tailor it to their needs.

Note that when selecting TreeNodes in code the SelectNode (DeselectNode also exists) method should be used. Note that when changing the colors of a TreeNode the ChangeColors method should be used. Do not just change the colors of a TreeNode.

Note that in order to iterate through the selected TreeNodes the following method has to be used (selected TreeNodes are stored in a Hashtable):

foreach(MWTreeNodeWrapper mwtnw in mwtvMWTreeView.SelNodes.Values)
{
   MessageBox.Show("The " + mwtnw.Node.Text + 
    " TreeNode is selected.");
}

Contacting me

I can be reached through the forum here at CodeProject or through one of my addresses:

  • My mik address can be found on netatonce.net.
  • My mick address can be found on ar.com.au.
  • My mikwib address can be found on hotmail.com.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Mikael Wiberg
Web Developer
Sweden Sweden
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionHow to access checked items? Pin
Alexander Pikus3-Nov-08 19:09
memberAlexander Pikus3-Nov-08 19:09 
GeneralDraga and Drop Behavior Pin
Larry Dodd5-Mar-08 10:45
memberLarry Dodd5-Mar-08 10:45 
GeneralRe: Draga and Drop Behavior Pin
vinutha kempanna5-Mar-08 10:57
membervinutha kempanna5-Mar-08 10:57 
GeneralRe: Draga and Drop Behavior Pin
Mikael Wiberg5-Mar-08 19:03
memberMikael Wiberg5-Mar-08 19:03 
QuestionGreat code, license question? Pin
thatrickguy29-Nov-07 5:53
memberthatrickguy29-Nov-07 5:53 
AnswerRe: Great code, license question? Pin
Mikael Wiberg29-Nov-07 6:42
memberMikael Wiberg29-Nov-07 6:42 
GeneralOdd behaviour on deselect [modified] Pin
benjymous19-Sep-07 22:09
memberbenjymous19-Sep-07 22:09 
GeneralNodes.Clear Doesn't Clear SelNodes Pin
Christopher Theunissen20-Apr-07 1:16
memberChristopher Theunissen20-Apr-07 1:16 
GeneralRe: Nodes.Clear Doesn't Clear SelNodes Pin
Mikael Wiberg20-Apr-07 6:07
memberMikael Wiberg20-Apr-07 6:07 
Call myMWTreeView.RemoveNode(s) if you want them removed from SelNodes as well - which I'm sure is what everyone wants.

If you have a solution as to how to find out when the Nodes property is cleared, I'm all ears Smile | :)
QuestionSearch as you type doesn't work on the SameLevelMultiBranch Pin
softer2-Apr-07 0:58
membersofter2-Apr-07 0:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 16 Aug 2004
Article Copyright 2004 by Mikael Wiberg
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid