SetDetailHeight

Description

Sets the height of each row in the specified range to the specified value.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object


Syntax

PowerBuilder

integer dwcontrol.SetDetailHeight ( long startrow, long endrow , long height )

Argument

Description

dwcontrol

A reference to a DataWindow control or DataStore for which you want to set the height of one or more rows in the detail area

startrow

The first row in the range of rows for which you want to set the height

endrow

The last row in the range of rows for which you want to set the height

height

The height of the detail area for the specified rows in the units specified for the DataWindow object


Return value

Returns 1 if it succeeds and -1 if an error occurs.

If any argument's value is null, in PowerBuilder and JavaScript the method returns null.

Usage

Call SetDetailHeight in a script to vary the amount of space assigned to rows in a DataWindow control or DataStore. You cannot specifically set the height for different rows when you define a DataWindow object in the DataWindow painter, although you can turn on the Autosize Height property for the detail band so that the height of each row is determined by the data.

You can set the detail height of one or more rows to zero, which hides them from view.

Examples

This statement sets the height of rows 2 and 3 to 500:

dw_1.SetDetailHeight(2, 3, 500)

This script retrieves rows for a DropDownDataWindow associated with the Company_Name column. It then hides rows 2 and 3 of the DropDownDataWindow by setting their detail height to 0:

DataWindowChild dwc;
integer rtncode;
 
rtncode = dw_1.GetChild("company_name", dwc)
IF rtncode < 0 THEN HALT
 
dwc.SetTransObject(SQLCA)
dwc.Retrieve( )
dwc.SetDetailHeight(2, 3, 0)