DataSet . DataSource , -.
, DataSet dsInactive dsBrowse, DataSource OnState, - UI, .
Auxiliar , , .
( )
procedure TForm1.DataSource1StateChange(Sender: TObject);
begin
if (DataSource1.State = dsBrowse) and (not FUIStateInSync) then
begin
//dataset is open, change UI accordingly
DBGrid1.Columns[0].Visible := SomeCondition();
//this will prevent the code to be executed again
//as state comes to dsBrowse after posting changes, etc.
FUIStateInSync := True;
end
else if (DataSource1.State = dsInactive) then
FUIStateInSync := False; //to let it happen again when opened.
end;
, , O.D. - , .