Click here to Skip to main content
12,510,238 members (50,353 online)
Click here to Skip to main content
Add your own
alternative version

Stats

192.9K views
20.2K downloads
138 bookmarked
Posted

The TreeListView To End All TreeListViews

, 10 Jun 2008 CPOL
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

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralFound a bug with clearing a TreeListView Pin
Patrick Fox22-Jan-09 5:48
memberPatrick Fox22-Jan-09 5:48 
GeneralRe: Found a bug with clearing a TreeListView Pin
Jan Eklund23-Feb-09 9:40
memberJan Eklund23-Feb-09 9:40 
QuestionHow do i change the editable property of a SubItem/Column to false? Pin
ron197711-Jan-09 19:41
memberron197711-Jan-09 19:41 
QuestionHow to set images in treeviewlist Pin
ML26136818-Jan-09 23:21
memberML26136818-Jan-09 23:21 
QuestionRe: How to set images in treeviewlist Pin
Frederik768-Mar-09 5:46
memberFrederik768-Mar-09 5:46 
AnswerRe: How to set images in treeviewlist Pin
ML261368115-Mar-09 20:51
memberML261368115-Mar-09 20:51 
GeneralGetting previous node sub-item into edit mode Pin
CutSack17-Dec-08 12:44
memberCutSack17-Dec-08 12:44 
GeneralA couple of bugs found with column auto resizing Pin
CutSack16-Dec-08 14:23
memberCutSack16-Dec-08 14:23 
Generalin VC++ Pin
samal.subhashree10-Dec-08 23:21
membersamal.subhashree10-Dec-08 23:21 
GeneralNewbie question Pin
Steve Faust7-Nov-08 12:15
memberSteve Faust7-Nov-08 12:15 
GeneralRe: Newbie question Pin
Patrick Fox19-Nov-08 10:58
memberPatrick Fox19-Nov-08 10:58 
GeneralRe: Newbie question Pin
Steve Faust21-Nov-08 7:04
memberSteve Faust21-Nov-08 7:04 
Question.NET 2.0, WinXP [modified] Pin
Dmitriy Iassenev26-Oct-08 5:44
memberDmitriy Iassenev26-Oct-08 5:44 
AnswerRe: .NET 2.0, WinXP Pin
Tosberg6-Dec-08 16:57
memberTosberg6-Dec-08 16:57 
Dmitriy,
Please send a screenshot and I'll take a look at it. Could you please explain further what you mean when you say "it would be more logical to finish column row with column color, not the control one"? I'm not sure I understand what you mean. Thanks!
AnswerRe: .NET 2.0, WinXP Pin
Jan Eklund27-Feb-09 9:22
memberJan Eklund27-Feb-09 9:22 
QuestionGrid lines in the very first column Pin
Dmitriy Iassenev26-Oct-08 5:39
memberDmitriy Iassenev26-Oct-08 5:39 
AnswerRe: Grid lines in the very first column Pin
Tosberg6-Dec-08 17:00
memberTosberg6-Dec-08 17:00 
GeneralImageList issue Pin
Dmitriy Iassenev26-Oct-08 5:28
memberDmitriy Iassenev26-Oct-08 5:28 
GeneralRe: ImageList issue Pin
Tosberg6-Dec-08 17:03
memberTosberg6-Dec-08 17:03 
QuestionColor and text alignment problems for Subitems Pin
francois panneton16-Oct-08 3:54
memberfrancois panneton16-Oct-08 3:54 
AnswerRe: Color and text alignment problems for Subitems Pin
Tosberg6-Dec-08 17:08
memberTosberg6-Dec-08 17:08 
AnswerRe: Color and text alignment problems for Subitems Pin
CutSack3-Feb-09 14:40
memberCutSack3-Feb-09 14:40 
AnswerRe: Color and text alignment problems for Subitems Pin
Karl S7-Jun-09 17:56
memberKarl S7-Jun-09 17:56 
QuestionListView and column problem Pin
mascix13-Oct-08 2:43
membermascix13-Oct-08 2:43 
GeneralExpand columns programatically Pin
morphias0@yahoo.com2-Oct-08 8:40
membermorphias0@yahoo.com2-Oct-08 8:40 
GeneralError TreeListNodeConverter Pin
iloR3-Sep-08 0:46
memberiloR3-Sep-08 0:46 
Generaltrail lines between sibling nodes Pin
areB24-Jul-08 20:25
memberareB24-Jul-08 20:25 
QuestionVery good: only a small bug on font? Pin
GiangySan4-Jul-08 1:04
memberGiangySan4-Jul-08 1:04 
AnswerRe: Very good: only a small bug on font? Pin
Tosberg23-Jul-08 16:01
memberTosberg23-Jul-08 16:01 
AnswerRe: Very good: only a small bug on font? Pin
Tosberg18-Oct-08 15:20
memberTosberg18-Oct-08 15:20 
GeneralRe: Very good: only a small bug on font? Pin
GiangySan13-Nov-08 23:00
memberGiangySan13-Nov-08 23:00 
GeneralSmall background color rendering bug Pin
Snakebyte24-Jun-08 12:34
memberSnakebyte24-Jun-08 12:34 
GeneralRe: Small background color rendering bug Pin
Tosberg23-Jul-08 15:59
memberTosberg23-Jul-08 15:59 
QuestionTyped data and Select all for copy ? Pin
claudetom0120-Jun-08 10:42
memberclaudetom0120-Jun-08 10:42 
AnswerRe: Typed data and Select all for copy ? Pin
Tosberg20-Jun-08 13:11
memberTosberg20-Jun-08 13:11 
GeneralRe: Typed data and Select all for copy ? Pin
claudetom0120-Jun-08 16:51
memberclaudetom0120-Jun-08 16:51 
GeneralRe: Typed data and Select all for copy ? Pin
claudetom0121-Jun-08 6:13
memberclaudetom0121-Jun-08 6:13 
AnswerRe: Typed data with DB Pin
claudetom0122-Jun-08 7:19
memberclaudetom0122-Jun-08 7:19 
GeneralRe: Typed data with DB Pin
Tosberg23-Jul-08 15:50
memberTosberg23-Jul-08 15:50 
GeneralLooking good! :) Pin
Jon Rista12-Jun-08 19:15
memberJon Rista12-Jun-08 19:15 
GeneralRe: Looking good! :) Pin
Tosberg13-Jun-08 1:19
memberTosberg13-Jun-08 1:19 
GeneralGood Job.... Pin
Gary Noble11-Jun-08 21:54
memberGary Noble11-Jun-08 21:54 
GeneralRe: Good Job.... Pin
Tosberg12-Jun-08 12:27
memberTosberg12-Jun-08 12:27 
GeneralRe: Good Job.... Pin
Jon Rista12-Jun-08 19:19
memberJon Rista12-Jun-08 19:19 
AnswerRe: Good Job.... Pin
Tosberg13-Jun-08 1:03
memberTosberg13-Jun-08 1:03 
GeneralThank you Pin
Paul Selormey11-Jun-08 6:04
memberPaul Selormey11-Jun-08 6:04 
GeneralRe: Thank you Pin
Tosberg11-Jun-08 14:27
memberTosberg11-Jun-08 14:27 
GeneralRe: Thank you Pin
Paul Selormey11-Jun-08 15:32
memberPaul Selormey11-Jun-08 15:32 
GeneralRe: Thank you Pin
Tosberg11-Jun-08 15:35
memberTosberg11-Jun-08 15:35 
QuestionScreenshot? Pin
Johnny J.10-Jun-08 21:42
memberJohnny J.10-Jun-08 21:42 

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.160929.1 | Last Updated 11 Jun 2008
Article Copyright 2008 by Ted Osberg
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid