GetRow  GetRowIdFromRow

Chapter 9: Methods for the DataWindow Control

GetRowFromRowId

Description

Gets the row number of a row in a DataWindow control or DataStore object from the unique row identifier associated with that row.

Syntax

long dwcontrol.GetRowFromRowId (long rowid {, DWBuffer buffer } )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow.

rowid

A number specifying the row identifier for which you want the associated row number.

buffer (optional)

A value of the dwBuffer enumerated datatype identifying the DataWindow buffer that contains the row.

For a list of valid values, see DWBuffer.

Returns

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, 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.

NoteRow identifiers The row identifier is relative to the DataWindow that currently owns the row.

Examples

Example 1

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.

long ll_rowid

long ll_rownumber


ll_rowid = dw_1.GetRowIdFromRow(dw_1.GetRow())

// suppose original order of rows changes...

ll_rownumber = dw_1.GetRowFromRowId(ll_rowid)

See also





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

View this book as PDF