Collapsing

Description

Occurs before a node in a TreeView DataWindow collapses.

PowerBuilder event information

Event ID: pbm_dwncollapsing

Argument

Description

row

Long by value. The number of the first row in the group to be collapsed.

grouplevel

Long by value. The TreeView level of the group to be collapsed.


Return Values

Set the return code to affect the outcome of the event. Return 0 to continue processing (collapse the selected node) or return any other value to cancel the collapse.

Usage

A TreeView node collapses when the user clicks the State icon (-) in the TreeView DataWindow or uses any of the Collapse methods.

The Collapsing event occurs before the Collapsed event.

Examples

The following statements in the Collapsing event script display a message box that allows the user to cancel the operation. The message box does not display if the Collapsing event was triggered by the CollapseAll or CollapseLevel methods:

Integer li_ret

if row <>-1 then 
   li_ret = MessageBox("Collapsing node",   &
      "Are you sure you want to collapse this node?",  &
      Exclamation!, OKCancel!)
   IF li_ret = 1 then      return 0   
ELSE      RETURN 1   END IF
END IF

See also

Collapsed

Expanding