vcl-dxmdaset-dot-tdxcustommemdata-dot-movecurrecordto-x28-system-dot-integer-x29.md
Moves the current record to a new position in the memory-based dataset.
procedure MoveCurRecordTo(AIndex: Integer);
| Name | Type | Description |
|---|---|---|
| AIndex | Integer |
The target position (as an ordinal number) in the memory-based dataset.
|
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.
The following code example moves the current record to the beginning of the memory-based dataset:
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
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