Click here to Skip to main content
15,881,424 members
Articles / Programming Languages / Visual Basic

The TreeListView To End All TreeListViews

Rate me:
Please Sign up or sign in to vote.
4.77/5 (38 votes)
10 Jun 2008CPOL3 min read 377.2K   27.8K   145   162
An extensible, hybrid Listview/TreeListView control

Download Notes

  • WinControls.ListView.Components - Components only for those of you who don't want to mess around
  • WinControls.TreeListView - Source Code for the control
  • WinControls.TreeListViewSample - Sample project using the new control
TreeListView01.jpg

Introduction/Background

I actually started this code about four years ago when I needed a ListView/TreeListView combination control for a project I was working on. I soon discovered Jon Rista's article (listed below) here on CodeProject and I was off and running. I felt I could build upon his initial idea and with a little help from what others have written (also listed below) and my own ideas, I started it. Unfortunately, the project I was on folded but not the control itself. I continued the work and have been working on it here and there and now have finally gotten around to putting it on CodeProject.

I hope you all find this control useful. Invariably there will be issues, errors or better ways to do things when coding is involved. I am always open to new ideas and designs on my code so don't be afraid to let me know about it. If anyone has any issues, ideas or critiques you can post on the message board and hopefully I'll get to it ASAP.

Control Highlights

  • Comes with a fully documented help file generated by SandCastle (Sandcastle .shfb file included in project for future development)
  • Code is fully commented for Intellisense support
  • Full Design-Time support (including Columns - just click on them in the IDE)
  • Default Drag-n-Drop functionality built in (just turn it on)
  • Default sorting
  • Default folder images if you don't add your own
  • Icon support for columns
  • Checkbox/RadioButton support for the ContainerListView and TreeListView
  • Ability to show/hide individual Checkboxes/RadioButtons
  • Ability to enable/disable individual CheckBoxes/RadioButtons
  • Hidden columns
  • Column/Row Tracking
  • Export the control to XML and import it back in
  • Export the entire control or just the nodes
  • GridLine functionality for the ContainerListView and TreeListView controls
  • Separate ContextMenu for the Columns
  • On the fly support for editing individual ContainerListViewItems, ContainerListViewSubItems, and TreeListNodes
  • Support for changing the color of multiple properties of both controls, including GridLines, RootLines, Highlight color, etc...
  • Ability to show/hide RootLines, ChildLines, GridLines and PlusMinus signs
  • Adding controls to ContainerListViewSubItems
  • Alpha support for colors
  • FullPath support for TreeListNodes so you know where you are in the tree
  • Ability to change the Path character when getting the FullPath of a TreeListNode
  • Branching functionality for TreeListNodes which means you can highlight, color, select, disable, etc.. a subset of nodes/childnodes in a Tree
  • and much, much more!

Other Notes

  • Properties that are only stubbed out for future development will have 'Not Supported' in the designer and intellisense.
  • You may have to remove the source control bindings and files from the code.
  • The solutions have been ported over to Visual Studio 2008. However, the target framework is the .NET 2.0 Framework so you could port the code back to Visual Studio 2005 with no problems if necessary.
  • Extract the sample project to the same directory as the source project as the sample project references the source project. Otherwise, you will have to re-reference the source project.

Thank-You's

History

  • 10th June, 2008: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Node Index Pin
Member 871587320-Sep-12 15:09
Member 871587320-Sep-12 15:09 
GeneralRe: Node Index Pin
Member 847159921-Sep-12 2:41
Member 847159921-Sep-12 2:41 
QuestionRow Background Color Pin
Member 847159911-Sep-12 5:29
Member 847159911-Sep-12 5:29 
AnswerRe: Row Background Color Pin
Member 871587319-Sep-12 23:28
Member 871587319-Sep-12 23:28 
GeneralRe: Row Background Color Pin
Member 847159920-Sep-12 7:51
Member 847159920-Sep-12 7:51 
GeneralRe: Row Background Color Pin
Member 871587320-Sep-12 14:57
Member 871587320-Sep-12 14:57 
QuestionTreelistview showing a red X Pin
Stefan Deuling10-Jun-12 12:53
Stefan Deuling10-Jun-12 12:53 
AnswerRe: Treelistview showing a red X Pin
Stormyshome29-Jan-15 10:27
Stormyshome29-Jan-15 10:27 
I got to this point simply by clicking a few times around in the treeview(colapsing and expanding) while horizontal scrollbar is visible.. Frown | :-(
QuestionRight-click multi-selection Pin
sgoffman10-Apr-12 7:31
sgoffman10-Apr-12 7:31 
SuggestionRowHeight Property in _findFirstNode function in TreeListView.vb module Pin
Jaf Alee29-Jan-12 11:16
Jaf Alee29-Jan-12 11:16 
QuestionNode index ??? Pin
Avelino Ferreira23-Jan-12 23:37
professionalAvelino Ferreira23-Jan-12 23:37 
QuestionColumn Size Fill or Auto Pin
Member 778338721-Jan-12 11:56
Member 778338721-Jan-12 11:56 
QuestionAutoscroll to node Pin
raiserle2-Jan-12 2:08
raiserle2-Jan-12 2:08 
QuestionMaybe a bug about Multiseleted drag-n-drop Pin
Member 77880329-Sep-11 23:39
Member 77880329-Sep-11 23:39 
QuestionIt is buggy Pin
Silan (Frank) Liu4-Aug-11 17:22
Silan (Frank) Liu4-Aug-11 17:22 
GeneralCheckBoxes Pin
AlKun28-Jul-11 23:20
AlKun28-Jul-11 23:20 
QuestionVisual Basic 2010 Express Pin
Dragonminds14-Jul-11 23:54
Dragonminds14-Jul-11 23:54 
GeneralMy vote of 5 Pin
dxFrety24-Jun-11 16:04
dxFrety24-Jun-11 16:04 
Generalnode collapsing problem on windows 7 Pin
Member 795727011-Jun-11 9:39
Member 795727011-Jun-11 9:39 
GeneralMy vote of 5 Pin
raiserle8-May-11 5:34
raiserle8-May-11 5:34 
QuestionFound a bug. Anyone else try this on Windows 7? Pin
Patrick Fox10-Jan-11 5:48
Patrick Fox10-Jan-11 5:48 
AnswerRe: Found a bug. Anyone else try this on Windows 7? Pin
Patrick Fox10-Jan-11 9:12
Patrick Fox10-Jan-11 9:12 
GeneralRe: Found a bug. Anyone else try this on Windows 7? Pin
Patrick Fox10-Jan-11 9:46
Patrick Fox10-Jan-11 9:46 
Generala few questions Pin
Xyux20-Sep-10 2:02
Xyux20-Sep-10 2:02 
GeneralSubitem edit Pin
emoneta29-Aug-10 20:53
emoneta29-Aug-10 20:53 

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.