Description:
I have a form containing an XtraTreeList, its node's values are updated at a fixed interval by a spearate thread. The thread calls a Refresh function which updates the values in the tree list. My TreeListNode.SetValue commands are wrapped in TreeList.BeginUnboundLoad and TreeList.EndUnboundLoad calls. However, sometimes I get exceptions. Why?
Answer:
The cause of this issue is that your thread code accesses the TreeList or its data source object directly without using delegates and BeginInvoke calls. Please review the Give Your .NET-based Application a Fast and Responsive UI with Multiple Threads article in the MSDN Library for more information and code samples illustrating this in detail.
In addition, please have a look at the articles available on the following links. They describe how to work with threading correctly using a very simple sample:
Safe, Simple Multithreading in Windows Forms, Part 1
Safe, Simple Multithreading in Windows Forms, Part 2
Safe, Simple Multithreading in Windows Forms, Part 3
Here are the other two useful articles:
How to populate the datagrid on background thread with data binding by using Visual C#
How to populate DataGrid on background thread with data binding by using Visual Basic 2005 or Visual Basic .NET
Once, you implement correct thread handling within your code, the obscure problems with random exceptions should go away.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.