Code: Select all
procedure TBasisFormFld.DataSource1StateChange(Sender: TObject);
begin
with DataSource1.DataSet do
begin
TlBtnNieuw.Enabled := (State in [dsBrowse, dsInactive]);
TlBtnEdit.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnPost.Enabled := State in [dsInsert, dsEdit];
TlBtnDelete.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnRecRew.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnRecForward.Enabled := (State = dsBrowse) and (RecordCount > 0);
TlBtnZoekModus.Enabled := (State in [dsBrowse, dsInactive]);
TlBtnZoekGevonden.Enabled := (State in [dsBrowse, dsInactive]);
end;
end;
I know, because in the childform the recordcount of TVirtualtable shows the correct recordcount.
I'm using TVirtualTable in MyDAC 5.570.0.42 with D2009 pro