tree control node disabled

Started by Jim Short, June 23, 2011, 06:22:19 AM

Previous topic - Next topic

Jim Short

Can a node on the tree be disabled (grayed out?). I see a visible property but not disable/enable.
I would like to display a node but prevent the user from selecting it until the time is right.
js
Jim Short

Fred Tomke

Hi, Jim, it's new to me that the Visible or Enable property could be used to hide/disable single nodes.
As far as I know the Enabled and Visible property could only applied to the whole tree control.

I'm sure that you only have to catch it at the beginning of SelChanged event: just save the previous selected tree node and re-select it when the user is trying to select the "disabled" tree node. But why isn't it better to show the tree node only at the time, when the user is allowed to select it (just for my understanding)?

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Jim Short

Hi Fred,

I have a part of the tree that is a start up sequence. One touches each of these nodes to establish initial conditions.
It would be nice if the main node would appear ready for use after start up is complete.
This is not a show stopper. I was just wondering about enable / disabled state. There does not seem to be one.

Cheers,
Jim
Jim Short

Fred Tomke

Hi, Jim, sounds interesting, but I'm afraid there is no simple solution. Event in the C#-API there is no Enabled property. To do that, it would be necessary to override the DrawItem event of the tree(nodes) and to make it visible as gray and italic and not selectable. In the end you'd get a new ActiveX control to place on your OpenDCL form. We'd say in this case: from the back through the breast into the eyes.

Sorry, that I can't help you.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Jim Short

Just knowing its a dead end is satisfying!
Your efforts greatly appreciated.
Thank You,
Jim
Jim Short