Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check whether a cell in a StringGrid is modified

I would like to know how to programatically determine that the data in a cell of the string grid is modified?

I have a string grid in a form. The data for the stringgrid is loading from the Database. If a user modifies the data, I would like to change the data in the database.

Please share the code.

Thanks

like image 764
user1469630 Avatar asked Dec 11 '25 13:12

user1469630


1 Answers

The TStringGrid class has an event OnSetEditText which is triggered when user changes data in a cell. Use ACol and ARow in the event handler's parameters to identify which cell has been modified...

procedure TForm1.StringGrid1SetEditText(Sender: TObject; ACol, ARow: Integer;
  const Value: string);
begin
  //Use ACol/ARow to know what has changed, and Value to know what the new data is.

end;
like image 65
Jerry Dodge Avatar answered Dec 13 '25 07:12

Jerry Dodge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!