Click here to Skip to main content
15,860,844 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 374.6K   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

 
QuestionAllow Control Added as SubItem to have focus Pin
John2424247-Mar-22 2:32
John2424247-Mar-22 2:32 
QuestionTrying to add control to a VS2019 project Pin
Member 1335104727-Mar-21 5:35
Member 1335104727-Mar-21 5:35 
QuestionItemDrop node to root-level? Pin
MillerME18-Sep-19 14:55
MillerME18-Sep-19 14:55 
QuestionUnable to adjust Node Font Pin
Member 1455319412-Aug-19 0:47
Member 1455319412-Aug-19 0:47 
QuestionHighlighting Multiple Nodes Pin
hunt_red_october27-May-19 22:26
hunt_red_october27-May-19 22:26 
QuestionTooltip pointing Pin
Member 139054504-Sep-18 5:14
Member 139054504-Sep-18 5:14 
QuestionProgrammatically Editing Cells Pin
Member 1348320724-Jan-18 8:39
Member 1348320724-Jan-18 8:39 
Suggestionmulti-column span Pin
hoffmaster_200018-Oct-16 12:38
hoffmaster_200018-Oct-16 12:38 
QuestionCannot update just one index of array of nodes (Bug??) Pin
Member 125542908-Jun-16 4:55
Member 125542908-Jun-16 4:55 
BugProblems with parsing multiple SelectedItems in TreeListView Pin
ovidiukt31-Mar-16 0:34
ovidiukt31-Mar-16 0:34 
QuestionProblem with sorting (order) columns Pin
Nguyễn Chí Việt Hùng14-Jul-15 0:32
Nguyễn Chí Việt Hùng14-Jul-15 0:32 
QuestionRe: Problem with sorting (order) columns Pin
Nguyễn Chí Việt Hùng16-Jul-15 5:52
Nguyễn Chí Việt Hùng16-Jul-15 5:52 
QuestionSubitem align Pin
Member 1111375821-Nov-14 9:44
Member 1111375821-Nov-14 9:44 
AnswerRe: Subitem align Pin
Inna CA12-Aug-15 11:47
Inna CA12-Aug-15 11:47 
BugRed cross over control Pin
Member 838175722-Sep-14 1:55
Member 838175722-Sep-14 1:55 
QuestionProblem with viewing Children Pin
Member 95907607-May-14 6:05
Member 95907607-May-14 6:05 
QuestionMultirow or RowSpan Pin
Nico Stöckigt19-Feb-14 3:27
Nico Stöckigt19-Feb-14 3:27 
Question2 bugs and 1 new feature Pin
NHenry4-Dec-13 3:24
NHenry4-Dec-13 3:24 
QuestionAbout selected item when resize treelistview Pin
lepteo1417-May-13 5:03
lepteo1417-May-13 5:03 
QuestionIs Selected node visible Pin
jbeersm3-Nov-12 19:06
jbeersm3-Nov-12 19:06 
GeneralRe: Is Selected node visible Pin
DynoEnviro31-Mar-15 6:18
DynoEnviro31-Mar-15 6:18 
SuggestionIs it possible to set the checkbox Three-State? Pin
horsewww25-Oct-12 5:43
horsewww25-Oct-12 5:43 
QuestionChange icon for SubItem Pin
Member 871587310-Oct-12 0:37
Member 871587310-Oct-12 0:37 
QuestionIcons, ImageList Pin
Mar©19701-Oct-12 22:24
Mar©19701-Oct-12 22:24 
AnswerRe: Icons, ImageList Pin
Member 87158739-Oct-12 15:55
Member 87158739-Oct-12 15:55 

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.