SetScroll

Description

Scrolls a Web DataWindow control to a specified row or to the prior or next page in the result set.

Applies to

Web DataWindow client control

Syntax

number dwcontrol.SetScroll ( scrollAction, data) 

Argument

Description

dwcontrol

A reference to a Web DataWindow client control.

scrollAction

An integer that indicates the scroll action to be taken. Values are:

  • 1 – Scroll to the row number indicated by data.

  • 2 – Scroll to the page indicated by data.

data

If scrollAction is 1, an integer that specifies the row number to scroll to.

If scrollAction is 2, an integer that specifies the page to scroll to. Values are:

  • 0 – Scroll to prior page.

  • 1 – Scroll to next page.

Returns

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

If dwcontrol is null, the method returns null.

Usage

The SetScroll method lets users scroll backwards and forwards through the result set one page at a time without causing a postback to the server. Calling ScrollPriorPage and ScrollNextPage causes the page to be reloaded with another set of rows from the result set.

If scrollAction is 1, SetScroll does not highlight the row. Use SelectRow to let the user know what row is current.


Events

SetScroll may trigger these events:

Examples

Example 1

This statement scrolls dw_employee to the prior page:

dw_employee.SetScroll(2, 0);

Example 2

This statement scrolls dw_employee to row 120:

dw_employee.SetScroll(1, 120);

See also