ScrollPriorRow  SelectedLength

Chapter 9: Methods for the DataWindow Control

ScrollToRow

Description

Scrolls a DataWindow control to the specified row. ScrollToRow changes the current row but not the current column.

Syntax

integer dwcontrol.ScrollToRow ( long row )

Argument

Description

dwcontrol

A reference to a DataWindow control or child DataWindow.

row

A value identifying the row to which you want to scroll. If row is 0, ScrollToRow scrolls to the first row. If row is greater than the last row number, it scrolls to the last row.

Returns

Returns 1 if it succeeds and -1 if an error occurs. If any argument’s value is NULL, the method returns NULL.

Usage

After you call ScrollToRow, the specified 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 change to display the row.

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


Events

ScrollToRow can trigger these events:

Examples

Example 1

This statement scrolls to row 10 and makes it current in the DataWindow control dw_employee:

dw_employee.ScrollToRow(10)

See also





Copyright © 2004. Sybase Inc. All rights reserved. SelectedLength

View this book as PDF