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
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With