ScrollPriorRow

Scrolls to the prior row in a DataWindow control.

To scroll

Use

To the prior row in a DataWindow, making the row current (when the DataWindow does not have the RichTextEdit presentation style)

Syntax 1

To the prior instance of a document associated with a row in a RichTextEdit control or RichTextEdit DataWindow

Syntax 2


Syntax 1 For DataWindow controls and child DataWindows

Description

Scrolls a DataWindow control backward one row. ScrollPriorRow changes the current row but not the current column.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object


Syntax

PowerBuilder

long dwcontrol.ScrollPriorRow ( )

Argument

Description

dwcontrol

A reference to a DataWindow or child DataWindow


Return value

Returns the number of the row displayed at the top of the DataWindow control when the scroll finishes or tries to scroll past the first row. ScrollPriorRow returns -1 if an error occurs.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

After you call ScrollPriorRow, the row before the current row becomes the new current row. If that row is already visible, the displayed rows do not change. If it is not visible, the displayed rows move down to display the row.

ScrollPriorRow does not highlight the row. Use SelectRow to let the user know what row is current.

Events

ScrollPriorRow triggers these events in the order shown:

RowFocusChanging
RowFocusChanged
ItemFocusChanged
ScrollVertical

You should not use ScrollPriorRow in the ScrollVertical event. Doing so causes this series of events to be triggered repeatedly until the first row in the DataWindow is reached.

Examples

This statement scrolls dw_employee to the prior row:

dw_employee.ScrollPriorRow()

See also

Scroll

ScrollNextPage

ScrollNextRow

ScrollPriorPage

ScrollToRow

SelectRow

Syntax 2 For RichTextEdit DataWindows

Description

Scrolls to the prior instance of the document in a RichTextEdit DataWindow.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control


Syntax

PowerBuilder

integer rtename.ScrollPriorRow ( )

Argument

Description

rtename

The name of the DataWindow control in which you want to scroll to the prior document instance. Each instance is associated with a DataWindow row.

The DataWindow object in the DataWindow control must be a RichTextEdit DataWindow


Return value

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

Usage

A DataWindow control with a RichText DataWindow object has multiple instances of the RichText document, where each instance is associated with one row of retrieved data.

ScrollPriorRow goes to the prior instance of the RichTextEdit document. In contrast, repeated calls to ScrollPriorPage pages back through all the pages of the document instance and then back to the pages for the prior row.

PowerBuilder RichTextEdit control

You can use the same syntax with any PowerBuilder RichTextEdit control. See the section called “ScrollPriorRow” in PowerScript Reference.

Examples

This statement scrolls to the prior instance of the RichText document in the DataWindow control dw_1. (Each document instance is associated with a row of data):

dw_rpt.ScrollPriorRow()

See also

Scroll

ScrollNextPage

ScrollNextRow

ScrollPriorPage