KB Article A651
Visible to All Users

How to optimize the XtraGrid's performance

Description:
What ways are there of optimizing the XtraGrid's screen refresh speed?
What options and features are "expensive" in performance terms when enabled?

Answer:
The XtraGrid's painting performance depends mainly on the number of visible grid columns and rows. More rows and columns displayed within the grid view, mean more time is needed to paint a grid view. Various in-place editors, custom cell styles, and the AutoRowHeight feature also slow down performance.
Advanced data features, such as groups, summaries and sorted columns have only an insignificant impact on painting performance. However, they may cause performance hits when the underlying data is changed and the XtraGrid needs to refresh groups and recalculate summaries.
If the XtraGrid paints too slowly in your application, please try to reduce the number of displayed rows and columns: reduce the GridControl height and hide some columns.
If performance problems are observed when refreshing data, try to reduce the number of summaries and grouped/sorted grid columns. Usually, you can substitute filters for groups. Summaries can be created/removed dynamically.

Show previous comments (3)
DevExpress Support Team 12 years ago

    Hi Holger,
    Here is a quote from our documentation about the BestFit method:
    Note that the number of processed data cells depends upon the GridView.BestFitMaxRowCount property value. If set to -1, all data cells are processed. If set to a positive integer, the property specifies the number of cells to be processed. Cells are processed starting from the top visible row.
    So, you can just set the BestFitMaxRowCount property to specify the BestFit behavior.
    I hope you will find this information useful.

      Absolutely interesting. Well, now we are talking. I add extra 20 pixels for graphics in the beginning of certain columns; when in CustomDrawCell() event. column.BestFit() don't know about this extra space; thereby cutting the last 20 pixels of the end of text. If I could somehow tell the BestFit() method that I want it to prefix with 20 pixels; the BestFit() algorithm could use this info to correctly fit the cell width. The interface could be something as simple as column.BestFit(int WidthExtention = 0).

      DevExpress Support Team 12 years ago

        Posting multiple questions within a report makes it difficult to properly track and process such items.
        In order to better serve you and track multiple questions in your inquiry, we have taken the liberty of separating the issues you addressed. For quick and efficient responses to your concerns, we kindly request that future inquiries address one issue at a time. Your time and cooperation are appreciated.

        1. GridControl - How to change the BestFit algorithm
          Please refer to this report for further correspondence on this item.

        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.