SetDetailHeight method (DataWindows)
Description
Sets the height of each row in the specified range to the
specified value.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>SetDetailHeight</span> ( long <span>startrow</span>, long <span>endrow</span> , long <span>height </span>) |
[Web DataWindow server component]
1 |
short <span>dwcontrol</span>.<span>SetDetailHeight</span> ( long <span>startrow</span>, long <span>endrow</span>, long <span>height </span>) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>SetDetailHeight</span> ( number <span>startrow</span>, number <span>endrow</span>, number <span>height</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control or |
startrow |
The first row in the range of rows for |
endrow |
The last row in the range of rows for |
height |
The height of the detail area for the |
Return Values
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:
1 |
dw_1.<span>SetDetailHeight</span>(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:
1 |
DataWindowChild dwc; |
1 |
integer rtncode; |
1 |
1 |
rtncode = dw_1.GetChild("company_name", dwc) |
1 |
IF rtncode < 0 THEN HALT |
1 |
1 |
dwc.SetTransObject(SQLCA) |
1 |
dwc.Retrieve( ) |
1 |
dwc.<span>SetDetailHeight</span>(2, 3, 0) |