DBgrid and event on cells ?? lazarus / 31-LCL ---------------------------------------------------------------------- Fabius · 2021-06-10 15:38 Hello Do you know a DBgrid for Lazarus with event (enter, exit ...) on the cells? ---------------------------------------------------------------------- bpranoto · 2021-06-10 16:20 TDBGrid has onColEnter and onColExit. You can use them  and the dataset afterScroll event to detect cell position changes. ---------------------------------------------------------------------- Fabius · 2021-06-10 16:27 Yes I know, I try to make it work, but it's not good for me I am looking for a dbgrid more evolve than that of the IDE Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  procedure TForm3.DBGrid1ColExit(Sender: TObject);var Xcompte : string;var Xlabel : string;Var MontantTMtv : extended; begin     if DBGrid1.SelectedField.FieldName = 'CREDIT' then    begin    StatusBar1.SimpleText := 'Champ Credit';    if ((DBGrid1.Columns[3].Field.Value > 0) AND (DBGrid1.Columns[2].Field.Value > 0) ) Then    begin    MontantTMtv :=  DBGrid1.Columns[2].Field.Value;   ////credit    Form1.Xsaisie.Edit;  Form1.Xsaisie.FieldByName('credit').AsFloat :=MontantTMtv;    Form1.Xsaisie.FieldByName('debit').AsFloat :=0;    Form1.Xsaisie.Post;    Form1.Xsaisie.Refresh;    DBGrid1.Refresh;    end;     DBGrid1.SelectedColumn.FieldName := 'DEBIT';      calcullignes;     end; ---------------------------------------------------------------------- Fabius · 2021-06-10 16:39 I test also But not Ok Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm3.DBGrid1ColExit(Sender: TObject);var Xcompte : string;var Xlabel : string;  begin     if DBGrid1.SelectedField.FieldName = 'CREDIT' then ///////credit en premier    begin      StatusBar1.SimpleText := 'Champ Credit';      if ((DBGrid1.Columns[2].Field.Value > 0) AND (DBGrid1.Columns[3].Field.Value > 0) ) Then      begin      DBGrid1.Columns[3].Field.Value := 0;      end;    end;          if DBGrid1.SelectedField.FieldName = 'DEBIT' then //////////Debit priorite      begin        if ((DBGrid1.Columns[3].Field.Value > 0) AND (DBGrid1.Columns[2].Field.Value > 0) ) Then    ///////////debit      begin         DBGrid1.Columns[2].Field.Value := 0;         end;         end; ---------------------------------------------------------------------- bpranoto · 2021-06-10 17:00 Quote from: Fabius on June 10, 2021, 06:27:28 pmYes I know, I try to make it work, but it's not good for me What do you mean with "not good"?  Is the event not fired? ---------------------------------------------------------------------- Fabius · 2021-06-11 04:10 Hello So of course the event is triggered!  but the manipulation of the fields does not give the good result that I hope If it is the last column (debit), the previous field (credit) is not set to zero if DBGrid1.SelectedField.FieldName = 'DEBIT' then //////////Debit priorite       begin         if ((DBGrid1.Columns[3].Field.Value > 0) AND (DBGrid1.Columns[2].Field.Value > 0) ) Then    ///////////debit         begin          DBGrid1.Columns[2].Field.Value := 0;         end;        end; And the rows all become the same (mix of rows) I tried to act on the dataset, same thing ... The Dbgrid is recalcitrant