editing record moves to the last in TClientDataSet

Editing a record in a TClientDataSet, causes it to move to the last. It should keep the current position!!!

(* edit recond n.10 *)

(* close and reopen the table *)
(* now the 10th record moved to last!!!! *)
Who is Participating?
mokuleConnect With a Mentor Commented:
You need to have an index which will force desired order.
Another solution is to replace table with query in which You'll set some sort order.
gianlucaAuthor Commented:
An index will affect the speed ?? I think it will slow Editing and Appending the records....
Generally an index is added for raising speed and maintaining desireed order.
Some slow down while adding is the cost. In most cases it is a fracton of advantages.
Tomas Helgi JohannssonCommented:
Adding an index optimal to a sertain query speeds the retrieval of
the data. Same goes for a table objects.
If space allocations for the index is well designed then adding an insert
will have minimal affects on update and insert to the table.

  Tomas Helgi
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.