Scrolls a Web DataWindow control to a specified row or to the prior or next page in the result set.
Web DataWindow client control
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:
|
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:
|
Returns 1 if it succeeds and -1 if an error occurs.
If dwcontrol is null, the method returns null.
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.
SetScroll may trigger these events:
ItemChanged
ItemError
ItemFocusChanged
RowFocusChanged
RowFocusChanging
This statement scrolls dwEmployee to the prior page:
objdwEmployee.SetScroll(2, 0);
This statement scrolls dwEmployee to row 120:
objdwEmployee.SetScroll(1, 120);