<< Return to Main Index

< Return to Class Index

CGXDBEGrid::GetRecordFromRow

long GetRecordFromRow(ROWCOL nRow);

nRow

Specifies the row id.

Return Value

A zero-based long number.

Remarks

Returns the zero-based row index associated with a row. GetRecordFromRow calls GetRowIndex and converts the row id to a zero-based record index.

If you override OnLoadCellStyle (or any other methods where you connect the grid to your data source), you should always take care to de-reference the index associated with a row. This will make it possible to add support for sorting rows.

Delegates to CGXBrowserLayoutManager::GetRecordFromRow

Example

This sample code shows you how you can use this method to dereference the original record associated with a row:

   // determine the record for the row
   long nRecord = GetRecordFromRow(nRow);

   // now, I can seek to the record
   GetDocument()->m_dbfile.Seek(nRecord);

See Also

CGXDBEGrid::GetRowIndex CGXDBEGrid::OnLoadCellStyle

CGXDBEGrid 

Class Overview | Class Members