way1:
On the first way, you could simply get the position of the DataSource before calling research(), like this:
MyTable myTableHolder;
myTableHolder.RecId = myTableRecord.RecId;
myTable_ds.research();
// or: myTableRecord.dataSource().research();
myTable_ds.findRecord(myTableHolder);
// or: myTableRecord.dataSource.findRecord(myTableHolder);
way 2:
The second way to do it will actually look for the correct record and then select it, so you can imagine it will perform a little worse than the others, but at least it will never fail (unless you, somehow, delete the record you're looking for in the meantime).
Simply copy the RecId from the record you want to keep selected to a new table buffer, like this:
int
position;
position = myTable_ds.getPosition();
myTable_ds.research();
myTable_ds.setPosition(position);
Comments
Post a Comment