Auto select tree entry

I want to autoselect the entry in the tree on the left of the Serial Matching screen (denoted by red arrow) when the Serial Number text box is populated (denoted by green arrow). I believe this can be accomplished in the text box Leave event but I have been unsuccessful in programmatically autoselecting the tree entry in my customization. Do any of you know if I can do this and if so, do you know an example of code I can use to do it?

Does anyone have an idea on how I can autoclick the item the red arrow is pointing at? I didn’t think this would be very hard but I haven’t been able to make anything work.

I have this now.

Erp.UI.App.SerialMatchingEntry.SerialMatchMethodTree ep = (Erp.UI.App.SerialMatchingEntry.SerialMatchMethodTree)csm.GetNativeControlReference(“8b490603-6dda-4639-85f5-066fdbe5d562”);
ep.ExpandAll();

	foreach (Infragistics.Win.UltraWinTree.UltraTreeNode node in ep.Nodes)
	{
		if (node.Selected)
		{
			ep.Nodes.Item(node.Index).Selected = true;
		}
		//node.Selected = true;
	}

but am getting this error.

CS1061 - line 91 (800) - ‘Infragistics.Win.UltraWinTree.TreeNodesCollection’ does not contain a definition for ‘Item’ and no extension method ‘Item’ accepting a first argument of type ‘Infragistics.Win.UltraWinTree.TreeNodesCollection’ could be found (are you missing a using directive or an assembly reference?)

Is there a custom reference I need to add?

I got it solved. This is how I did it.

Erp.UI.App.SerialMatchingEntry.SerialMatchMethodTree ep = (Erp.UI.App.SerialMatchingEntry.SerialMatchMethodTree)csm.GetNativeControlReference(“8b490603-6dda-4639-85f5-066fdbe5d562”);
ep.ExpandAll();

	foreach (Infragistics.Win.UltraWinTree.UltraTreeNode node in ep.Nodes)
	{
		ep.ActiveNode = node;
        ep.ActiveNode.Selected = true;
        ep.Select();
	}