Jump to content

Bookmark for unidbgrid


MOGSY

Recommended Posts

Hi, 

 

Just create a private variable in the form i.e

 

bm:TBookmark;

 

 

To record the current position you just assign the bookmark from the TADOQuery linked to the Tdatasource / Datasource for the unidbgrid. i.e

 

bm:=rst.Bookmark;

 

To set the correct cursor position afterwards is then just the opposite - below also with an additional validation.

 

if rst.BookmarkValid(bm) then rst.Bookmark:=bm;
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

thank you for your support, but I think this is not the solution.

 

An example

 

DataSet with 2 Fields (ClientDataSet)

 

Country || Priority

 

The data are sorted by Country and shown in a unioDBGrid. The DBGrid is grouped by Priority

 

1. After the first reading I have the following situation

 

Priority 100

Italy || 100

Switzerland || 100    (is selected)

 

Priority 50

French || 50

 

2. Data had changed --> after a refresh

 

Priority 100

Italy || 100

 

Priority

French || 50  (is selected)

Switzerland || 50

 

now the wrong record is selected.

 

Is there any solution for that problem?

 

Best regards

 

 

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...