Back to Devexpress

TdxCustomMemData.MoveCurRecordTo(Integer) Method

vcl-dxmdaset-dot-tdxcustommemdata-dot-movecurrecordto-x28-system-dot-integer-x29.md

latest2.0 KB
Original Source

TdxCustomMemData.MoveCurRecordTo(Integer) Method

Moves the current record to a new position in the memory-based dataset.

Declaration

delphi
procedure MoveCurRecordTo(AIndex: Integer);

Parameters

NameTypeDescription
AIndexInteger

The target position (as an ordinal number) in the memory-based dataset.

|

Remarks

Call the MoveCurRecordTo procedure to move the current record to any position in the memory-based dataset. To identify the number of records stored in the dataset, use the RecordCount property.

Note

The MoveCurRecordTo procedure accepts only positive numbers as the AIndex parameter. If you pass 0 or a negative value, a MoveCurRecordTo procedure call has no effect.

Code Example: Rearrange Dataset Records

The following code example moves the current record to the beginning of the memory-based dataset:

delphi
dxMemData1.DisableControls; // Disables data synchronization with bound controls
  try
    dxMemData1.MoveCurRecordTo(1); // Moves the current record to the first position
  finally
    dxMemData1.EnableControls; // Re-enables data synchronization with bound controls
  dxMemData1.First; // Sets the moved record as current
cpp
dxMemData1->DisableControls(); // Disables data synchronization with bound controls
  try
  {
    dxMemData1->MoveCurRecordTo(1); // Moves the current record to the first position
  }
  __finally
  {
    dxMemData1->EnableControls(); // Re-enables data synchronization with bound controls
  }
  dxMemData1->First(); // Sets the moved record as current

See Also

TdxCustomMemData Class

TdxCustomMemData Members

dxmdaset Unit