1. Troy Cowan
  2. PowerBuilder
  3. Thursday, 4 August 2022 14:13 PM UTC

I would like to disable the normal expand/collapse behavior when doubleclicking on a treeview node. Is this possible?

If not, if I add code to the Doubleclicked event handler to "take over" the expand/collapse state, would this happen before or after the node expands/collapses "under the hood"?

Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 4 August 2022 18:53 PM UTC
  2. PowerBuilder
  3. # 1

Put code in the SelectionChanging event of the treeview in order to determine how to proceed, of IF you wish to proceed!

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Thursday, 4 August 2022 14:21 PM UTC
  2. PowerBuilder
  3. # 2

If it's a treeview, then take a look to ItemExpanding event. Returning 1 prevents treeview from expanding.

Andreas.

Comment
  1. Andreas Mykonios
  2. Thursday, 4 August 2022 14:27 PM UTC
And of course you do have also itemcollapsing event...

Andreas.
  1. Helpful
  1. Troy Cowan
  2. Thursday, 4 August 2022 14:42 PM UTC
Yes, that is a step in the right direction. Unfortunately, it seems to be in effect not just for doubleclick, but for single clicking on the node's negative sign - not sure exactly what that is called, but the box to the left of the node's label that normally allows you to expand/collapse that node. For my purposes, I need to allow collapsing that way but not by doubleclicking. There isn't that context passed in to the event, but maybe I can figure it out somehow.
  1. Helpful
  1. Andreas Mykonios
  2. Friday, 5 August 2022 07:06 AM UTC
What you should think is what is the difference between clicked and doubleclicked event. A single click will call only clicked event. But I believe that a doubleclick will call clicked and then doubleclicked event. So I'm not sure what you have in mind is possible.

Andreas.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 4 August 2022 14:17 PM UTC
  2. PowerBuilder
  3. # 3

Hi Troy;

  Are you asking about doing this on a TreeView Control or a TreeView DataWindow?

Regards ... Chris 

Comment
  1. Troy Cowan
  2. Thursday, 4 August 2022 14:24 PM UTC
Treeview Control
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.