2
Suppose a FDQuery
with a select
simple be connected with a DBGrid
.
I want to prevent the user from making any edits to the registry.
I know there’s a choice EnableDelete
in the FDQuery
, but if the user tries to delete the record, for example, the FireDAC
will generate an exception.
You can prevent Editing/Inserting/Deleting without generating an exception?
This control cannot be done on DBGrid
, has to be done in the Dataset
.
More details:
- Delphi XE7
- Firebird 2.5
- I want to make a generic solution because I have this problem in
several screens and have use the
FDQuery
in a inherited component, apply the solution in this inherited component would solve my problem in all the screens of the system.
Which exception is being triggered when the user tries to delete in
DBGrid
?– Celso Marigo Jr
@Celsomarigojr The native exception of Firedac: [Firedac][Comp][DS]-215. Record deleting for dataset [Query1] is disabled.
– Andrey
@Celsomarigojr I edited the question....
– Andrey
In this case you would also have to inherit the
DBGrid
then you would make the configuration ofReadOnly
only once too?– Celso Marigo Jr
I agree with you that would be a good solution, but I can not change all
dbgrid´s
of my system at this time. The solution needs to be applied in Dataset (FDQuery
). @Celsomarigojr– Andrey