Florentin,
Wolgang was right. I was busy with my session for Virtual FoxFest.
At first glance I think the problem is that the DbDataSource returns the # of records in the table when asked by the Grid for the # of rows. And it does not subtract the # of deleted rows. That would explain why there is an empty row at the bottom.
Give me some time to look at this.
The alternative solution would be to use the DbDataTable(). This reads the contents from the cursor in a (detached) DataTable. A deletion in the table will remove the DataRow (move it to a list of deleted rows).
The disadvantage of this approach is that you will have to write the changes back to the database when you commit the changes (with a button or when you close the form).
I showed how this can be done in my session for VFF a couple of years ago,
It boils down to:
Code: Select all
oTable := DbDataTable()
SELF:DataContext := oTable
.
.
.
DbTableSave(oTable)
To see what happens when save is executed, look here
https://github.com/X-Sharp/XSharpPublic ... e.prg#L113
I'll look into this asap.
Robert