The issue here is not DataSet.IsEmpty:
procedure TViewNovaEntidadeRelacional.DeleteFK;
begin
if not mtFKs.IsEmpty then
begin
mtFKs.Delete;
end;
end;
There is one record in the Dataset.
When calling the method above, as IsEmpty = false, mtFKs.Delete Is Called.
But the DGBrid continues to show the record.
Calling the method again, doesn´t do anything, because now, DataSet.IsEmpty = true.
procedure TViewNovaEntidadeRelacionalNovaFK.FiltraMtDestino;
begin
mtColunasDestino.Filtered := false;
mtColunasDestino.Filter := '';
if Trim(edtFiltro.Text) <> '' then
begin
mtColunasDestino.Filter := 'NomeCampo = ' + QuotedStr('*' + edtFiltro.Text + '*');
mtColunasDestino.Filtered := true;
end;
end;
If I type X on the edtFiltro, It should result an Empty DataSet, because there is no record with the "X" character on the "NomeCampo" field, but the DBGrid shows the first record of the dataset and DataSet.IsEmpty = true.
So.....
I don´t think that the problem is DataSet.IsEmpty.
In my previous experience with TBufDataset DataSet.IsEmpty is buggy.