Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
WebDataTree, InitialDataBindDepth, manually loading when needed
posted

Have this WebDataTree:

<ig:WebDataTree ID="itemtree" class="ItemTree" runat="server"
DataSourceID="hdsItem" SelectionType="Single"
NodeIndent="10" InitialDataBindDepth="1">
<AutoPostBackFlags SelectionChanged="On" />
<DataBindings>
<ig:DataTreeNodeBinding DataMember="dsItemCategoryRoot_DefaultView"
KeyField="CategoryID" TextField="Description" ValueField="CategoryID"
TargetField="Category" />
<ig:DataTreeNodeBinding DataMember="dsItemCategory_DefaultView"
KeyField="CategoryID" TextField="Description" ValueField="CategoryID"
TargetField="Category" />
<ig:DataTreeNodeBinding DataMember="dsItem_DefaultView" KeyField="InventoryID"
TextField="Name" ValueField="InventoryID" TargetField="Inventory" />
</DataBindings>
</ig:WebDataTree>

...that is bound to a datasource and setup to automatically download nodes on demand, with a InitialBindDepth of 1.
It works perfectly, it loads all the root nodes and then loads a set of children when I expand a node.

I also have some code that seeks a certain node in the tree. (code below) It finds the node by key, then sets that as the active node, expands it, and expands all ancestors to that point. The problem is, while it allows me to set that as the active node, the children of that node might not be loaded yet. Is there a way I can continue to have it load on demand, but also manually force it to load the children of a certain node if I need to?

itemtree.ActiveNode = MyNode
itemtree.ActiveNode.Expanded = True
itemtree.ActiveNode.ExpandAnscestors()
itemtree.ActiveNode.Selected = True