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
320
Programmatically check duplicate nodes. v8.2
posted

gooday all,

a tree has nodes, some are duplicate nodes (i.e., representing the same underlying product).

In-memory DataTable (DuplicateNodeTable) holds duplicate nodes information.

when user checks a node, UltraTree_BeforeCheck event fires,  here i check to see if the node exists in DuplicateNodeTable.

if the node is one of the duplicate node in the table==>> get reference to the tree like so:

                        UltraTree DuplicateTree = this.dsExBar.Groups[row.Row["SchemaID"].ToString()].Container.Controls[0] as UltraTree;

try and get a reference to the node like so:

                        duplicateNode = DuplicateTree.Nodes[row.Row["treeHierarchyID"].ToString()];

row.Row["treeHierarchyID"].ToString(), is the nodes Key Property, i.e Tree.Nodes[string Key]

 an error is thrown, "Key not found Parameter name: key"

 

i have made sure that the Key property is initialized correctly. why is error thrown?

 

thanks.