01-17-2019 12:08 AM
Hi Experts
I'm using a Tree control and the user can select one or more Items (rows)
Sometimes i need to lock the control so that the user cant change the selected items. I use a Property Node to disable the control.
However the Disable also disable the Scrollbars.
I want the user to be able to vertically scroll through the Tree, without the possibility to change the value. (selected items)
How to do?
Best regards
Per
Solved! Go to Solution.
01-17-2019 03:16 AM - edited 01-17-2019 03:19 AM
01-17-2019 03:26 AM
01-17-2019 05:22 PM
If the tree is always disabled, it should be fairly easy to do something like the attached.
Basically, the tree has a method that converts a mouse click to a row/column and will also tell if the mouse click is within the content rectangle of the tree. If it's not, that means the mouse click occurred on the border of the tree or inside the scrollbar. Either way, enable the tree for scrolling until the mouse goes back up.
If the tree is sometimes enabled and sometimes disabled as you say, you'll need to store the current disabled status and restore it on mouse up. If it's already enabled, you don't want to disable it on mouse up. I'll leave that for you to figure out.
01-17-2019 05:35 PM
You could also just use the Discard? terinal in that Mouse Down? event when you decided that you do not want the user to change anything. Or use the similar Edit Cell? filter event instead.
01-17-2019 05:45 PM
@rolfk wrote:
You could also just use the Discard? terinal in that Mouse Down? event when you decided that you do not want the user to change anything. Or use the similar Edit Cell? filter event instead.
I don’t think so. If you discard the mouse down, you won’t be able to use the scroll bar.
01-17-2019 06:06 PM
Even if you only discard it when it is in the visible colums?
01-18-2019 12:58 AM - edited 01-18-2019 12:59 AM
Thanks Aputman!
Exactly what i asked for. 🙂 There are some cool functions that can be implemented with that method!
Another question. Is there a way to do the same with Indent/outdent? (still without allowing to change the value(s))
In some situation i want the user to browse through the tree without changing the selection. (access to Scroll, Indent/Outdent.)
In other cases it should be possible to have full access.
Best regards
Per
01-18-2019 01:04 AM
I think Rolf's suggestion is better - it doesn't require toggling properties.
01-18-2019 02:25 AM
Hi Pauldavey
Agree. !
But the main solution was to use the "Mouse in bounds" methods as aputman surgested.
Br Per