I have found exceptions reported in our application specific Event log that are related to the UltraWinTree and/or the UltraTreeNode. At this point I have not been able to reproduce it but it appears in the log daily and I hoping someone might be able to suggest a possible cause. Here's the stack trace:
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Exception Type: NullReferenceException
Message: Object reference not set to an instance of an object.
Stack Trace:
at Infragistics.Win.UltraWinTree.UltraTreeNode.get_IsLastViewableSibling()
at Infragistics.Win.UltraWinTree.NodeClientAreaUIElement.ShouldDrawVerticalConnectorToBottom(TreeNodeUIElement nodeUI)
at Infragistics.Win.UltraWinTree.NodeClientAreaUIElement.PositionChildElements()
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements()
at Infragistics.Win.UltraWinTree.UltraTreeUIElement.PositionChildElements()
at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered)
at Infragistics.Win.ControlUIElementBase.get_CurrentCursor()
at Infragistics.Win.UltraControlBase.get_Cursor()
at Infragistics.Win.UltraWinTree.UltraTree.get_Cursor()
at System.Windows.Forms.Control.WmSetCursor(Message& m)
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)
We are using version 9.2.20092.2083 of the WinForms controls.
One other thing, is that I am using one of my personal accounts to report this. The company that I work for has valid licenses for this software but the developer responsible for the licenses information and who usually would post question/help requests is no longer associated with the company. I don't currently have an account associated with those licenses (or his account information), how would I go about creating an account that associates me with the company's licenses?
What constitutes dirtying a node? For instance would a tag on a node or changing nodes key (not display text) dirty the node and require a refresh of the tree.
I have finally encountered in this in the development environment, but the steps are not readily reproducible. All I can say is it happens when the tree is re-populated, but not every time. I can re-populate the tree 20 times and then on the 21st with the same data it will fail. The next time I encounter may be after re-populating the tree 6 times.
While examining the code I did find that we are initiating a BeginUpdate from inside our retrieval thread and I am changing this to be invoked. For testing purposes I wrapped the BeginUpdate with a try/catch to see if this was explicitly the location that was blowing up, but nothing is caught here and the exception is still raised and reported.
Can starting the BeginUpdate in the data retrieval thread and updating the tree from the GUI thread via properly invoked calls result in the behavior seen?
Yes, there sure is. This code will get hit any time the tree paints when one of it's UIElements has been marked dirty. So basically, this code gets call any time anything is changed in the tree and the tree paints.
I have one other question. Other than an EndUpdate on the tree, is there anything other action on the tree that may have caused it to take that code path?
I understand that the lack code makes this difficult diagnose. Unfortunately the level of complexity here will make it difficult for me to post a code sample. I'll continue to dig into my code to see there is a cross thread issue.
Answering your question there only the standard GUI thread and the data retrieval thread involved.
For now I have patched our code to catch the issue quietly and I'll see if that helps the user and if the tree remains stable. I'm sure I'll find out today because the patch was released this morning.
No fun when you can't duplicate the issue in the dev environment.
Thanks for the responses.
Well, if the tree is not bound and you are certain that nothing in your code is touching the tree or it's data without properly invoking, then I'm not sure what is causing the exception.
This certainly feels like a threading issue, but I can't see your code, so I can't say if there is a hole somewhere that is updating the tree data on another thread. Are there other threads at work beside the data retrieval thread? Does some of your tree cells contain objects that might be referenced by the other thread?
Of course, it is always possible that this is a bug in the tree, but without a sample to reproduce the exception, there's no way to track it down.