Subject How to correctly change ordering without loosing current record?
Author G. Nau
I'm comparing ordering changes between the IB-TDataset
compatible and IB-native components.
I like the behavior of TDataset change in ordering while still holding
the actual position and record. I'm missing that with IB native
components. I'm sure there is something in the excellent IB native
components to help me with this issue ..

Example:
CUSTOMER database with CUSTID, NAME, other fields (like
address, phone)
ORDERITEMS are 1=CUSTID, 2=NAME
a grid is showing the query-results

On TDataset/IB_native to change ordering I use
-Query.OrderItemNo=x (1 or 2)
-query.refresh;

Navigating to a name say "Duffy" and change orderings between 1
and 2 the results in the grid are:
IB_native: I'm loosing the selected record "DuffyD" after a change
TDataset: DuffyD record is nailed and changing the order still keeps
the actual row on that record. That's nice! Even the position within
the grid is constant.

How can this behavior be replicated with IB_native?
a.) stay with the actual record even if ordering is changed
b.) optional: even keep the actual position within the grid (for
example 5th row from the top)

Maybe some automatic search for the PK of the "old" record after
the change?

Many thanks for your assistance
Gunther