billcch
Joined: 19 Jan 2007 Posts: 44
|
Posted: Tue Dec 07, 2010 1:49 am Post subject: Generating children when needed... |
|
|
I am using VT 4.0.0, and set Data Binding as Object Binding (and set ChildProperty) in Infralution Virtual Tree Editor. Under the root node (hidden), there are few nodes, but each node contains huge amount of child nodes, and those nodes are created on demand (when the parent node is expanding)....
Code: |
IList<myNode> Children
{
get
{
if(_children == null)
{
if(expanded)
{
// generating thousands child nodes and assign into _children list
GenerateChildren();
}
else
{
if(HasChild /* fast search if at least 1 child node exists */ )
{
return _dummyNodeList; // A list contains only 1 dummy node
}
}
}
return _children;
}
|
Ok, here is my question... I know VirtualTree needs only small amount of nodes when need, but my GenerateChildren() function is creating thousands nodes.
Is any better way to setup my VirtualTree to generate nodes when necessary needed?
Thanks |
|