I need a horizontal tree control
-
I need a horizontal tree control that would look like all the trees one sees in data structures textbooks, but have all the usual functionality (check boxes, drag/drop, etc.) Does such a thing exist? The root would be center/top. Nodes would grow down to the left or right. Leaves would all be at the bottom. How hard would it be to convert a std tree control into a horizontal one?
-
I need a horizontal tree control that would look like all the trees one sees in data structures textbooks, but have all the usual functionality (check boxes, drag/drop, etc.) Does such a thing exist? The root would be center/top. Nodes would grow down to the left or right. Leaves would all be at the bottom. How hard would it be to convert a std tree control into a horizontal one?
It would be very hard - and probably incredibly stupid - to make the "standard" tree control do such a thing. First of all, the .NET tree control is actually the
SysTreeView32
common control in Windows, wrapped in a class for easy use with .NET. With this in mind, you have to go very low-level to change such behavior. Since you're changing so much, however, it'd be much easier to do this from scratch in a completely managed solution. What you're describing, however, is common in organization charts. You could try searching for an existing organization chart control in .NET, which may help in constructing a more generic tree with the behavior you want. I can't think of any off-hand, but I'm willing to bet there's a few around - perhaps even here on CodeProject.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
It would be very hard - and probably incredibly stupid - to make the "standard" tree control do such a thing. First of all, the .NET tree control is actually the
SysTreeView32
common control in Windows, wrapped in a class for easy use with .NET. With this in mind, you have to go very low-level to change such behavior. Since you're changing so much, however, it'd be much easier to do this from scratch in a completely managed solution. What you're describing, however, is common in organization charts. You could try searching for an existing organization chart control in .NET, which may help in constructing a more generic tree with the behavior you want. I can't think of any off-hand, but I'm willing to bet there's a few around - perhaps even here on CodeProject.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
That's an excellent tip. Thanks! Dave
-
It would be very hard - and probably incredibly stupid - to make the "standard" tree control do such a thing. First of all, the .NET tree control is actually the
SysTreeView32
common control in Windows, wrapped in a class for easy use with .NET. With this in mind, you have to go very low-level to change such behavior. Since you're changing so much, however, it'd be much easier to do this from scratch in a completely managed solution. What you're describing, however, is common in organization charts. You could try searching for an existing organization chart control in .NET, which may help in constructing a more generic tree with the behavior you want. I can't think of any off-hand, but I'm willing to bet there's a few around - perhaps even here on CodeProject.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
I think an org chart control would do what I need. I searched on Google and CodeProject, and I only found one org chart component: http://www.anextech.com/AnexTree.htm If anyone has other suggestions, I appreciate them. I don't mind purchasing a good control, but I would like to get source code with it. The above control doesn't include source. Otherwise, it's pretty much what I was looking for. Thanks.