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
4165
Node is null, then one second later, it is not?
posted

Hi,

I have these three lines of code:

//previously remove afterSelect event

1: if (utvProjectView.ActiveNode.Parent.Nodes.Count == 1)
2:     utvProjectView.ActiveNode.Parent.Remove();
3: else
4:   utvProjectView.ActiveNode.Remove();
5: utvProjectView.AfterSelect += new AfterNodeSelectEventHandler(utvProjectView_AfterSelect);
6: utvProjectView.ActiveNode.Selected = true;

I put a stopper on line 6. When I hold my mouse over ActiveNode, it says null. If I wait 2 seconds, hold my mouse over ActiveNode again, then suddenly it shows it being as the first node in the tree. What gives? And I don't have the event hooked twice (afterSelect) so the 2 second pause is not because some other piece of code is executing.

Thanks.