Search code examples
ajaxdelphidatasetdbgrid

How to refresh dbgrid without close and open dataset in delphi?


I need to refresh dbgrid constantly, in real time. Close and open dataset works fine, but blink the dbgrid. What can I do to avoid this?

I'd like a solution like Ajax, that update only the necessary.

Thanks


Solution

  • Have you tried to use Disable- & EnableControls?

    DataSet.DisableControls;
    try
      DataSet.Close;
      DataSet.Open;
    finally
      DataSet.EnableControls;
    end;
    

    Furthermore, it should be possible to just call DataSet.Refresh instead of closing and opening to get the same result.