Hi,
I try to use the "InsertPosition" navigation property in a TDBADVGrid connected to a TClientDataset
(TADOQuery -> TDataSetProvider -> TClientDataSet -> TDatasource -> TDBAdvGrid)
I want the grid to add a row when the "INSERT" key is pressed. I've changed :
"Navigation/ AllowInsertRow" to "True"
and
"InsertPosition" to "pInsertAfter"
Rows are inserted after the current row, EXCEPT when the current row is the last one of the grid. The new row is then inserted before the last row ...
I've done the test with a TAdvStringGrid, and the row was added at the end of the grid, after the last row.
Is it the expected behavior on the TDBAdvGrid or do i miss something ?
Many Thanks.
Benoit
In TDBAdvGrid does InsertPosition is not used. An Insert is done at dataset level and it is your dataset that determines where the record will be inserted, the grid has no control over the dataset's insert position.
TDBAdvGrid does not used InsertPosition... Really ?
How explain that rows are not inserted the same way then changing the value :
PInsertBefore : rows are always inserted before the current row
PInsertAfter : rows are inserted after the current row except if the current row is the last one.
Regards.
Benoit