10-21-2015 04:23 AM
Hello;
I have to build a tree control with a lot of items reading from a database. If i read all at the beginning it needs a lot of time to create the tree so I only charge the Parents and, If I double click in the item I do the query to the database to charge the childs.
The problem is that if I don't double click in the item idon´t have the expand/collapse icon (because there aren´t childrens yet) until I double click on it to get the childrens.
Is there any way to show the expand/collapse icon without childrens in the parent?
Thanks;
10-21-2015 07:06 AM
anderg wrote:
Is there any way to show the expand/collapse icon without childrens in the parent?
I'm not sure (probably not), but you can fill two levels rather than just the top level. When the user opens an item, you populate the all children of that item, so that they all have their children. This takes however long it takes, but because it's only the children of one item, it's not as long as populating the entire tree.
10-21-2015 08:59 AM
A workaround might be to add an empty child item when you create the tree. This will cause the expand symbol to be visible. After clicking the expand symbol, the empty item is deleted and the database entries are populated in its place.
10-22-2015 04:39 AM
10-22-2015 04:53 AM
@anderg wrote:
The problem is that there is no way (no event ) to detect when the user clicks on the expand symbol
You have two events: Item Open? and Item Open.