RowsMove method (DataWindows)
Description
Clears a range of rows from one DataWindow control (or DataStore)
and inserts them in another. Alternatively, RowsMove moves rows
from one buffer to another within a single DataWindow control (or
DataStore).
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>RowsMove</span> ( long <span>startrow</span>, long <span>endrow</span>, <br> DWBuffer <span>movebuffer</span>, datawindow <span>targetdw</span>, long <span>beforerow</span>,<br> DWBuffer <span>targetbuffer</span> )<br>integer <span>dwcontrol</span>.<span>RowsMove</span> ( long <span>startrow</span>, long <span>endrow</span>,<br> DWBuffer <span>movebuffer</span>, datastore <span>targetdw</span>, long <span>beforerow</span>,<br> DWBuffer <span>targetbuffer</span> )<br>integer <span>dwcontrol</span>.<span>RowsMove</span> ( long <span>startrow</span>, long <span>endrow</span>, <br> DWBuffer <span>movebuffer</span>, datawindowchild <span>targetdw</span>, <br> long <span>beforerow</span>, DWBuffer <span>targetbuffer</span> ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>RowsMove</span> (number <span>startrow</span>, number <span>endrow</span>,<br> number <span>movebuffer</span>, datawindow <span>targetdw</span>, number <span>beforerow</span>,<br> number <span>targetbuffer</span> )<br>number <span>dwcontrol</span>.<span>RowsMove</span> (number <span>startrow</span>, number <span>endrow</span>,<br> number <span>movebuffer</span>, datawindowchild <span>targetdw</span>, <br> number <span>beforerow</span>, number <span>targetbuffer</span> ) |
Argument |
Description |
---|---|
dwcontrol |
The name of a DataWindow control, DataStore, |
startrow |
The number of the first row you want |
endrow |
The number of the last row you want to |
movebuffer |
A value of the dwBuffer enumerated datatype (PowerBuilder) For a list of valid values, see DWBuffer. |
targetdw |
The name of the DataWindow control or |
beforerow |
The number of the row before which you |
targetbuffer |
A value of the dwBuffer enumerated datatype (PowerBuilder) For a list of valid values, see DWBuffer. |
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
When you use RowsMove, the rows have the
status NewModified! in the target DataWindow.
If you move rows between buffers in a single DataWindow control
or DataStore, PowerBuilder retains knowledge of where the rows came
from, and their status is changed accordingly. For example, if you
move unmodified rows from the primary buffer to the delete buffer,
they are marked for deletion. If you move the rows back to the primary
buffer, their status returns to NotModified!. Note, however, that
if you move rows from one DataWindow control (or DataStore) to another
and back again, the rows’ status is NewModified! because
they came from a different DataWindow.
The RowsMove method triggers the RowFocusChanging
and RowFocusChanged events only when the row number of
the current row is changed. The current row is simply
a number that indicates which row is the current row. A change in
the content of the row does not trigger the events if the number
of the current row remains the same.
Suppose you have a DataWindow with two rows. If the current
row is row 1 and RowsMove moves row 1, row 2
becomes the current row, but its row number also changes from 2
to 1. The events are not fired because the current row number is
still row 1. If the current row is row 2 and RowsMove moves
row 1, the events are fired because the current row number has changed
from row 2 to row 1.
When you use RowsMove, data is not automatically
retrieved for drop-down DataWindows in the target DataWindow, as
it is when you call InsertRow. You must explicitly call Retrieve
for child DataWindows in the target.
When you use RowsCopy or RowsMove to
populate another DataWindow, the copied data is not automatically
processed by filters or sort criteria in effect on the target DataWindow.
You might be required to call the Filter, GroupCalc,
or Sort methods to properly process the data.
Uses for RowsMove include:
-
Moving several rows from the
primary buffer to the delete buffer, instead of deleting them one
at a time -
Moving rows from the delete buffer to the primary
buffer, to implement an Undo capability in your application

A DataWindow cannot be in query mode
when you call the RowsMove method.
Examples
This statement moves all the rows starting with the
first row in the delete buffer for dw_1 to the primary
buffer for dw_1, thereby undeleting these rows:
1 |
dw_1.<span>RowsMove</span>(1, dw_1.DeletedCount(), Delete!, & |
1 |
dw_1, 1, Primary!) |