GetRowFromRowId method (DataWindows)
Description
Gets the row number of a row in a DataWindow control or DataStore object
from the unique row identifier associated with that row.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
long <span>dwcontrol</span>.<span>GetRowFromRowId</span> (long<span> rowid</span> {, DWBuffer <span>buffer</span> } ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.GetRowFromRowId (number<span> rowid</span> {, number <span>buffer</span> } ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
rowid |
A number specifying the row identifier |
buffer (optional) |
A value of the dwBuffer enumerated datatype For a list of valid values, see DWBuffer. |
Return Values
Returns the row number in buffer. Returns
0 if the row number is not in the current buffer and –1
if an error occurs.
If any argument value is null, in PowerBuilder and JavaScript
the method returns null.
Usage
This method allows you to use a unique row identifier to retrieve
the associated DataWindow or DataStore row number. The row identifier
is not affected by operations (such as Insert, Delete,
or Filter) that might change the original order
(and consequently the row numbers) of the rows in the DataWindow
or DataStore.

The row identifier is relative to the DataWindow that currently
owns the row.
Examples
This example uses the row identifier previously obtained
using the GetRowIdFromRow method to retrieve
the row’s number after the original order of the rows in
the DataWindow has changed.
1 |
long ll_rowid |
1 |
long ll_rownumber |
1 |
1 |
ll_rowid = dw_1.GetRowIdFromRow(dw_1.GetRow()) |
1 |
// suppose original order of rows changes... |
1 |
ll_rownumber = dw_1.<span>GetRowFromRowId</span>(ll_rowid) |