Hi.
I'm looking for an efficient little algorithm to traverse the text property of a .NET treeView node list. When the user is finished adding new nodes and eventually hits save I need to check that the text property (that contains the user entered friendly name) is still unique.
Life would be easy if the treeView key happened to be this datum, but it is not (its a GUID, but gotta let the users enter a friendly name).
Any better ideas than a introducing a new method with a foreach loop to check for duplicate names in the text property for every one of the nodes? BTW - I already have each individual node available in the current codepath...I'm traversing the list once to look for other (easier) conditions to offer feedback on. foreach (TreeNode node in treeView.Nodes[0].Nodes) { ... }
Thanks, Bob