TechnoTone Posted September 24, 2003 Posted September 24, 2003 I have a list of branch numbers that I want to display as the top-level in a tree view. Then, for each branch there is a list of names. Finally, under each name is a list of items. Each item has a number of columns. Something like this: BRANCH 1 ¦_Name 1 ¦ ¦_item 1 aaa bbb ccc ¦ ¦_item 2 aaa bbb ccc ¦_Name 2 ¦ ¦_item 1 aaa bbb ccc ¦ ¦_item 2 aaa bbb ccc BRANCH 2 ¦_Name 1 ¦ ¦_item 1 aaa bbb ccc ¦ ¦_item 2 aaa bbb ccc ¦_Name 2 ¦ ¦_item 1 aaa bbb ccc ¦ ¦_item 2 aaa bbb ccc Is it possible to display this in a TreeView so that the "branch numbers" and "names" are collapsable/expandable? Additionally, I need to be able to select individual items with checkboxes and be able to select groups of items with checkboxes on the "names" and "branch numbers" too. Is this also possible? Would I be better off using a datagrid? Can a datagrid contain a 3-level hierarchy? Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* divil Posted September 24, 2003 *Gurus* Posted September 24, 2003 I don't know about the datagrid, and I have never ownerdrawn a treeview. That said, it isn't difficult to do if you've got msdn and time to spare learning the messages and structures you need to hook in to it. You're going to have to do that if you want some nodes to be checkable etc. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
TechnoTone Posted September 24, 2003 Author Posted September 24, 2003 I was afraid that would be the case. Nothing worth doing is ever easy! Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
AlexCode Posted September 24, 2003 Posted September 24, 2003 A datagrid can have n level hierachy... but dont forget that you want the checkboxes... this wold mean that you will have to create a custom column witch edits it self with a checkbox... so on... The TreeView is a much better option... Read these URLs carefully and you'll find your answer: http://www.codeproject.com/cs/miscctrl/treeviewexplorer.asp http://www.codeproject.com/cs/miscctrl/mwcontrols.asp http://www.codeproject.com/cs/miscctrl/treeviewms.asp Quote Software bugs are impossible to detect by anybody except the end user.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.