are u sure that disablecontrolls diables master/detail?
I have to check this everytime again if i run through that. It disables the visual controls, but master details too?
in every case possible:
- remove the master source and set again after
close the detail dataset and reopen
Look for "NotifyDetails" as well as "ControlsDisabled "
Code: Select all
procedure TDataSet.DataEvent(Event: TDataEvent; Info: Longint);
procedure NotifyDetails;
var
I: Integer;
begin
if Assigned(FNestedDataSets) then
begin
if State <> dsInsert then UpdateCursorPos;
for I := 0 to FNestedDataSets.Count - 1 do
with TDataSet(FNestedDataSets[I]) do
if Active then DataEvent(deParentScroll, 0);
end;
if (State = dsBlockRead) then
for I := 0 to FDataSources.Count - 1 do
TDataSource(FDataSources[I]).NotifyLinkTypes(Event, Info, False);
end;
var
I: Integer;
NotifyDataSources: Boolean;
begin
NotifyDataSources := not (ControlsDisabled or (State = dsBlockRead));
case Event of
deFieldChange:
begin
if TField(Info).FieldKind in [fkData, fkInternalCalc] then
SetModified(True);
UpdateCalcFields;
end;
deFieldListChange:
FieldList.Updated := False;
dePropertyChange:
FieldDefs.Updated := False;
deCheckBrowseMode:
CheckNestedBrowseMode;
deDataSetChange, deDataSetScroll:
NotifyDetails;
deLayoutChange:
begin
FieldList.Updated := False;
if ControlsDisabled then
FEnableEvent := deLayoutChange;
end;
deUpdateState:
if ControlsDisabled then
begin
Event := deDisabledStateChange;
Info := Integer(State <> dsInactive);
NotifyDataSources := True;
FEnableEvent := deLayoutChange;
end;
end;
if NotifyDataSources then
begin
for I := 0 to FDataSources.Count - 1 do
TDataSource(FDataSources[I]).DataEvent(Event, Info);
if FDesigner <> nil then FDesigner.DataEvent(Event, Info);
end;
end;