MOGSY Posted February 21, 2018 Share Posted February 21, 2018 HI How to use bookmark on a unidbgrid to keep the cursor position? Many Thanks Quote Link to comment Share on other sites More sharing options...
alfr Posted February 21, 2018 Share Posted February 21, 2018 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; Quote Link to comment Share on other sites More sharing options...
bbm Posted March 14, 2018 Share Posted March 14, 2018 Hi, but how is the way in a grouped dbgrid and the order has changed Best regards Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 14, 2018 Share Posted March 14, 2018 Hi, UniDBGrid -> WebOptions -> RetainCursorOnSort ? Quote Link to comment Share on other sites More sharing options...
bbm Posted March 14, 2018 Share Posted March 14, 2018 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.