Difference between revisions of "TTreeView/es"

From Free Pascal wiki
Jump to navigationJump to search
Line 3: Line 3:
 
Se puede añadir un nuevo elemento mediante TTreeView.Items.AddChild o bien  AddChildObject.
 
Se puede añadir un nuevo elemento mediante TTreeView.Items.AddChild o bien  AddChildObject.
  
==Creating a TreeView which loads items only when expansing==
+
==Crear un TreeView que carga elementos solamente cuando se expande==
  
 
To add the expansion symbol to a node without subitems use:
 
To add the expansion symbol to a node without subitems use:

Revision as of 14:59, 10 January 2014

Añadiendo un nuevo elemento mediante código

Se puede añadir un nuevo elemento mediante TTreeView.Items.AddChild o bien AddChildObject.

Crear un TreeView que carga elementos solamente cuando se expande

To add the expansion symbol to a node without subitems use:

MyNode.HasChildren := True;

And then set an event handler for the OnExpanding event. In this even you should return if the expansion can actually be made or not and when yes, you should add subitems to the node. If the expansion cannot be done, the expansion symbol will be automatically removed even if you have previously set HasChildren to true.