-2

I have a virtual table dataset in Delphi, that operates with thousands of rows. After each change in DB I use thread to fetch the changes from the DB and then refresh a data set. But this leads to move of the screen after the Locate to current row operation (because I completely update the virtual table after thread ends). This is inconvinient for eyes, and sometimes user might click on the wrong row.

So I decided to edit the changed row directly instead of Locate (DataSet.Edit and DataSet.Post). But I am able to do that only when the cursor is on the specific row. If the user is on the different row, this method doesn't give any point, as I would have to move the cursor to the needed row, make changes and then locate back to the row user is standing on. Which would of course move the screen!

You got my point. Is there any solutuion to edit the DataSet "silently", so the user wouldn't feel that? Thanks.

  • 1
    No, I don't think readers will have got your point necessarily. Please add the code you are using to your q (see the article about providing a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) ) . – MartynA Dec 18 '19 at 16:15
  • There's a "related" section to the right of the page, little bit downwards... See the question titled "delphi - restore actual row in DBGrid" and decide if your question is a duplicate of that one. I can't tell if it is so by myself because you haven't even mentioned what row are you talking about (is it a grid?). – Sertac Akyuz Dec 18 '19 at 18:21

1 Answers1

0

You can use DisableControls to disable notification to the datasource and when ending your task reactivate with EnableControls , DisableControls and EnableControls are TDataSet method

ghostdz
  • 1
  • 2