ml.
ml.

Reputation: 163

How to use bookmarks and DisableControls

Is it possible to do

dataset.DisableControls
Bookmark1 := dataset.Bookmark;
{ do someting............. }
dataset.enableControls;
dataset.Bookmark := Bookmark1;
dataset.FreeBookmark(Bookmark1);

Let say getting the total of a TDBGrig.

Upvotes: 3

Views: 10762

Answers (1)

Sertac Akyuz
Sertac Akyuz

Reputation: 54772

There's no particular order for either disabling the controls first or getting a bookmark. You can navigate through records and use bookmarks while controls are disabled. The important thing is you'd want to enable the controls after record navigation is complete. So you'd switch the first two statements in your example code.

A sample usage is: get a bookmark, disable the controls, loop through the records then return to the bookmark, enable the controls and free the bookmark. See the example code in the "Marking and Returning to Records" topic of the documentation.

Upvotes: 4

Related Questions