Description:
How to improve the grid's data loading performance?
Answer:
First, please note that the XtraGrid does not put any data into its internal buffer, so, the slow down the grid introduces to your application can only be caused by painting. You may learn more on how the grid works with data if you read the XtraGrid Data Binding Specifics article.
Please try to perform the following test. Unlink the XtraGrid from its data source and run the app. Do you see a big difference between your initial project and the newly created one? If yes, we suggest that you implement a data loading routine in the background thread. Please review the "Give Your .NET-based Application a Fast and Responsive UI with Multiple Threads" MSDN article available at the following URL for more information and some code samples which illustrate this in detail:
http://msdn.microsoft.com/msdnmag/issues/03/02/Multithreading/default.aspx
In addition, please take 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
Also, here are a couple of useful articles, which contain a sample project demonstrating how to populate a DataGrid with data from a background thread:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318607
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318604
You may implement the same approach if you are using the XtraGrid in your application.
You may slightly improve the DataLoading process and completely eliminate the grid painting effect if you call the View's BeginUpdate method before and EndUpdate after your query is opened.
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.