I need help setting up a component. It works fine and displays everything, but only until the data is updated. As soon as DisableControls and EnableControls are activated, the current cursor position is immediately unhighlighted. This means that when the form is opened, the cursor position object isn't highlighted, and focus is restored only when the cursor is changed. Is this a bug, or is there a setting that ensures this behavior?
if bdsExecutiveResource.Active then
begin
bdsExecutiveResource.DisableControls;
if ID=0 then
begin
bdsExecutiveResource.First;
end
else
begin
index:=bdsFormBuffer.FieldByName('EXECRES_ID').AsInteger;
bdsExecutiveResource.First;
while not bdsExecutiveResource.EOF do
begin
if bdsExecutiveResource.FieldByName('ID').AsInteger=index then
begin
break;
end
else begin
bdsExecutiveResource.Next;
end;
end;
end;
bdsExecutiveResource.EnableControls;
if ID=0 then
begin
bdsExecutiveResource.First;
end;
if not ReadOnly then
VirtualDBTreeEx1.ExpandAll;
end;
The goal is to make user selections in a tree. All but the tree handle the situation correctly. However, if I try to reassign the datasource, an error occurs. The assignment handler is not completed for VirtualDBTreeEx1.
VirtualDBTreeEx1.DataSource:=nil;
VirtualDBTreeEx1.DataSource:=dsExecutiveResource;