Click here to Skip to main content
11,484,402 members (66,596 online)
Click here to Skip to main content

The TreeListView To End All TreeListViews

, 10 Jun 2008 CPOL 158K 17.3K 133
Rate this:
Please Sign up or sign in to vote.
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)

Share

About the Author

Ted Osberg
Software Developer (Senior)
United States United States
No Biography provided

Comments and Discussions

 
QuestionSubitem align Pin
Member 1111375821-Nov-14 10:44
memberMember 1111375821-Nov-14 10:44 
BugRed cross over control Pin
Member 838175722-Sep-14 2:55
memberMember 838175722-Sep-14 2:55 
QuestionProblem with viewing Children Pin
Member 95907607-May-14 7:05
memberMember 95907607-May-14 7:05 
QuestionMultirow or RowSpan Pin
Nico Stöckigt19-Feb-14 4:27
memberNico Stöckigt19-Feb-14 4:27 
Question2 bugs and 1 new feature Pin
NHenry4-Dec-13 4:24
memberNHenry4-Dec-13 4:24 
QuestionAbout selected item when resize treelistview Pin
lepteo1417-May-13 6:03
memberlepteo1417-May-13 6:03 
QuestionIs Selected node visible Pin
jbeersm3-Nov-12 20:06
memberjbeersm3-Nov-12 20:06 
GeneralRe: Is Selected node visible [modified] Pin
Member 1123207731-Mar-15 7:18
memberMember 1123207731-Mar-15 7:18 
SuggestionIs it possible to set the checkbox Three-State? Pin
horsewww25-Oct-12 6:43
memberhorsewww25-Oct-12 6:43 
QuestionChange icon for SubItem [modified] Pin
Member 871587310-Oct-12 1:37
memberMember 871587310-Oct-12 1:37 
QuestionIcons, ImageList Pin
Mar©19701-Oct-12 23:24
memberMar©19701-Oct-12 23:24 
AnswerRe: Icons, ImageList Pin
Member 87158739-Oct-12 16:55
memberMember 87158739-Oct-12 16:55 
QuestionRe: Icons, ImageList Pin
stelios19846-Mar-14 4:46
memberstelios19846-Mar-14 4:46 
QuestionColumn Hide Pin
Member 871587326-Sep-12 21:19
memberMember 871587326-Sep-12 21:19 
AnswerRe: Column Hide Pin
Member 87158739-Oct-12 16:56
memberMember 87158739-Oct-12 16:56 
QuestionGridlines Pin
Member 871587320-Sep-12 15:57
memberMember 871587320-Sep-12 15:57 
AnswerRe: Gridlines Pin
Member 847159921-Sep-12 3:56
memberMember 847159921-Sep-12 3:56 
QuestionNode Index Pin
Member 871587320-Sep-12 0:22
memberMember 871587320-Sep-12 0:22 
AnswerRe: Node Index Pin
Member 847159920-Sep-12 9:13
memberMember 847159920-Sep-12 9:13 
GeneralRe: Node Index [modified] Pin
Member 871587320-Sep-12 16:09
memberMember 871587320-Sep-12 16:09 
GeneralRe: Node Index [modified] Pin
Member 847159921-Sep-12 3:41
memberMember 847159921-Sep-12 3:41 
QuestionRow Background Color [modified] Pin
Member 847159911-Sep-12 6:29
memberMember 847159911-Sep-12 6:29 
AnswerRe: Row Background Color Pin
Member 871587320-Sep-12 0:28
memberMember 871587320-Sep-12 0:28 
GeneralRe: Row Background Color Pin
Member 847159920-Sep-12 8:51
memberMember 847159920-Sep-12 8:51 
GeneralRe: Row Background Color Pin
Member 871587320-Sep-12 15:57
memberMember 871587320-Sep-12 15:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.150520.1 | Last Updated 11 Jun 2008
Article Copyright 2008 by Ted Osberg
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid