Collapse

Description

Collapses a group in a TreeView DataWindow that has the specified TreeView level and includes the specified row. 

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control


Syntax

PowerBuilder

Integer dw_control.Collapse(long row, long groupLevel)

Argument

Description

dw_control

A reference to a TreeView-style DataWindow control

row

The number of the row that belongs to the TreeView level of the group to be collapsed

groupLevel

The TreeView level of the group to be collapsed


Return value

Returns 1 if the collapse operation succeeds and one of the following negative values if it fails:

-1 -- DataWindow is null

-5 -- One or more of the parameters are invalid

-16 -- DataWindow is not a TreeView DataWindow

Usage

A TreeView DataWindow has several TreeView level bands (groups) that can be expanded and collapsed. You can use the Collapse method to collapse a group in a TreeView DataWindow that includes a particular row in a particular TreeView level.

The Collapse method triggers the Collapsing and Collapsed events.

Examples

The following example collapses the group at TreeView level 2 that includes row 3:

integer li_ret
li_ret = dw_treeview.Collapse(3,2)

See also

CollapseAll

CollapseAllChildren

CollapseLevel

Expand