Hi,
I have a tree with two nodes. One node and then a child node
Node Parent
Node Child
The child is using the checkbox style. The parent is not.
When I uncheck the node, when the after_check event is finished: (version 13.2.20132.2023)
ystem.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.UltraWinTree.UltraTreeNode.NodeUiaProviderStub.GetParent() at Infragistics.Win.UIAutomation.Stubs.FragmentUIAProviderStub.GetParentStub() at Infragistics.Win.UIAutomation.Stubs.FragmentUIAProviderStub.GetAutomationId() at Infragistics.Win.UltraWinTree.UltraTreeNode.NodeUiaProviderStub.GetAutomationIDInternal() at Infragistics.Win.UltraWinTree.UltraTreeNode.VerifyNodeUiaProviderStub() at Infragistics.Win.UltraWinTree.UltraTreeNode.GetUiaProviderStub(Boolean createIfNeeded) at Infragistics.Win.UltraWinTree.UltraTreeNode.GetUiaProviderStub() at Infragistics.Win.UltraWinTree.NodeCheckBoxUIElement.DoClick() at Infragistics.Win.UltraWinTree.NodeCheckBoxUIElement.OnClick() at Infragistics.Win.ControlUIElementBase.ProcessMouseUpHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I suffer of the same problem with the same callstack: my applycation crashes due to this not catched exception.
Rolling in the deep I understood what was my problem: I was modifying tha checked status of the parent node of a node and I do that in the AfterCheck event of the node itself.
So now I left the after check event to finish and THEN I propagate the checked status to the parent nodes. It works.
I hope this will be helpfull
Regards
Multi-Thread must be the culprit. Let me investigate that and I will post back to this thread and mark your remark as an answer.
The error message appears to be coming from the UIAutomation implementation of the tree node. In order for that code to be hit at all, there must be some application running which is hooking into and listening for UIA notification like an accessibility application. I think Windows 8 has some apps that run by default which might be doing this.
I took a look at the code, though, and I can't see any way this code could be failing under ordinary circumstances. The code is asking for the Node and it's owning collection. Since the node in this case exists and is part of a collection, I can't see any way that this could fail, unless you are using the tree in a multi-threaded application and something is getting out of synch.
Just to be sure, I tried it out in a very simple sample with a tree and two nodes just like you described and I can't get any exception to occur.
So there must be some other factor here that isn't mentioned in your post.
Are you able to reproduce the issue in a small sample project and post it here so we can check it out?