Recent

Author Topic: TVirtualDBTreeEx and update dataset  (Read 118 times)

Sharfik

  • New member
  • *
  • Posts: 8
TVirtualDBTreeEx and update dataset
« on: June 10, 2026, 07:36:30 am »
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?

Code: Pascal  [Select][+][-]
  1. if bdsExecutiveResource.Active then
  2.       begin
  3.       bdsExecutiveResource.DisableControls;
  4.  
  5.         if ID=0 then
  6.         begin
  7.             bdsExecutiveResource.First;
  8.         end
  9.         else
  10.         begin
  11.             index:=bdsFormBuffer.FieldByName('EXECRES_ID').AsInteger;
  12.             bdsExecutiveResource.First;
  13.             while not bdsExecutiveResource.EOF do
  14.             begin
  15.                if bdsExecutiveResource.FieldByName('ID').AsInteger=index then
  16.                begin
  17.                   break;
  18.                end
  19.                else begin
  20.                  bdsExecutiveResource.Next;
  21.                end;
  22.             end;
  23.         end;
  24.         bdsExecutiveResource.EnableControls;
  25.         if ID=0 then
  26.         begin
  27.             bdsExecutiveResource.First;
  28.         end;
  29.         if not ReadOnly then
  30.         VirtualDBTreeEx1.ExpandAll;
  31.       end;
  32.  

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.

Code: Pascal  [Select][+][-]
  1. VirtualDBTreeEx1.DataSource:=nil;
  2. VirtualDBTreeEx1.DataSource:=dsExecutiveResource;
  3.  
« Last Edit: June 10, 2026, 07:51:35 am by Sharfik »

 

TinyPortal © 2005-2018