With delphi, i have a dbgrid. I want when user has filled the row and posted it, the line of grid is readonly
Do you have any suggestion ?
thank you
To prevent accidental / unwanted edits you can turn off the AutoEdit
property of the TDataSource providing data to the DBGrid. Then be sure any controls like a DBNavigator do not have edit enabled.
From the Delphi Help:
Description
Specifies whether the data source should call the Edit method automatically.
AutoEdit is true by default. If AutoEdit is true, then when a user attempts to modify the data displayed by the control, the data source calls the underlying dataset's Edit method.
Set AutoEdit to false to protect data from unintentional modification. Even if AutoEdit is false, an application can explicitly call a dataset's Edit method to allow data modification.
I suggest to keep a list with all rows (All data or just the primary key or the row ID) already updated by the user. Before allowing an update, you check the list.