I'm having some difficulties using ClientDataSet.StatusFilter := [usDeleted]
.
It doesn't do anything. I'm having my ClientDataSet hooked up to a Provider.
When applying the StatusFilter the DataSet does not display the deleted records.
It just shows the records as before applying the StatusFilter.
On the other hand. If I use ClientDataSet.CreateDataSet
which isn't hooked up to a provider and only use the ClientDataSet as an in-memory DataSet then the StatusFilter works as described in the documentation.
The DataSet only displayes the deleted records.
The ClientDataSet.UpdateStatus also shows the correct status usDeleted.
The only way I can get my first ClientDataSet that is hooked up to a provider to display the deleted records is by using the ClientDataSet.Delta property. But this doesn't allow me to Revert a deleted record.
//Note: cds.LogChanges = true
cds := TClientDataSet.Create(nil);
cds.Data := MyClientDataSet.Delta;
cds.First;
while not cds.eof do
begin
case cds.UpdateStatus of
usModified:
begin
ShowMessage('Modified');
cds.RevertRecord;
end;
usInserted: ShowMessage('Inserted');
usDeleted: ShowMessage('Deleted');
end;
cds.Next;
end;
cds.Free;
What am I doing wrong?