How to easy update changes in DBGrid+SQLQuery? lazarus / 16-Databases ---------------------------------------------------------------------- vladvons · 2013-09-07 11:23 There is simple Query with DBGRid presentation SQLQuery1.SQL.Text := ' SELECT * FROM products WHERE products_price = 99'     I want automatically to post Grid changes when cursor skips to another record. Is there somewhere property to make it without writing following code? Now i use additional bitton with code to save changes: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); begin   SQLQuery1.Edit();  SQLQuery1.Upda]"]>Blockedde := UpWhereChanged;  SQLQuery1.ApplyUpdates();  SQLTransaction1.Commit();  SQLQuery1.Close();  SQLQuery1.Open();                                 or such another method Code: [Select]                                procedure TForm1.DBGrid1EditingDone(Sender: TObject); begin    SQLQuery1.ApplyUpdates(); end; ---------------------------------------------------------------------- exdatis · 2013-09-07 15:03 In my opinion you must apply updates if you use SQLdb, but try some experiments on event onScroll?! e.g if Query.State in [dsEdit, dsInsert] then ... ---------------------------------------------------------------------- taazz · 2013-09-07 15:08 Personally I would use the SQLQuery AfterPost event to call ApplyUpdates everything else is a bit long winded for my liking.