I have an application for iOS/android developed with Delphi XE8 FMX.
In the app I have a treeview with tree items. When I add a tree item to a node when that same parent node is expanded, then I need to either a) collapse and expand the parent node from the app itself or b) do that programmatically ( see below ) to get the tree item to show right away. I tried calling 'repaint', but that did not work. Is there a better work around? Sometimes when calling the collapseall, expandall like I do below, then some of the tree nodes become unresponsive ( non-selectable ) until after I first select the top most tree node.
procedure TnewForm.AddTreeItemClick(Sender: TObject);
var
t:TTreeViewItem;
begin
t:=TTreeViewItem.Create(nil);
t.Text:=NewTreeItemEdit.Text;
if TreeView.Selected<>nil then
begin
t.Parent:=TreeView.Selected
end else
t.Parent:=TreeView;
//Treeview.Repaint;
treeview.CollapseAll;
treeview.ExpandAll;
NewTreeItemEdit.Text:='';
end;
How can I make dynamically added tree items show right away without collapsing/expanding the treeview?
You could try this.