> listview.items.beginupdate;
> try
>   listview.items.clear;
>   <Add dummy item>
>   listview.items.clear;
>   <add your list of items>
> finally
>   listview.items.endupdate
> end;

Is this related to the single invisible root-node problem in the treeview I wonder...

Here's the code that upsets the TTreeView... Note that it's only an issue if your
program requires that the tree be empty to indicate no selection inbetween states
containing data. NB Earlier discussion indicated the fault was in the MS handling
of the message TVM_DELETEITEM which performs incorrectly inside a
Begin...EndUpdate... It could well be the same for TListView

procedure MakeAnInvisibleTreeNode;
begin
  TreeView.Items.BegniUpdate;
  TreeView.Items.Clear;
  TreeView.Items.endupdate;
  TreeView.Items.add(nil,'I''m invisible');
end;

Add a second node and the treeview wakes up and draws both...
note that the first node is in the tree - you can click it, you just
can't look at it ;)

Is this a known bug?

The following fixes (read treats the symptoms) it...

procedure MakeAVisibleTreeNode;
begin
  TreeView.Items.BegniUpdate;
  TreeView.Items.Clear;
  TreeView.Items.add(nil,''); {temporary node}
  TreeView.Items.endupdate;
  TreeView.Items.Clear;
  TreeView.Items.add(nil,'I''m visible now');
end;

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to