How To Cache Rows In DevExpress ASP.NET GridView

ASP.NET Team Blog
22 September 2009

ASPxGridViewSuite Check out this short article on how to use the row caching property of the ASPxGridView and an upcoming feature of the ASPxPivotGrid:

What is EnableRowsCache?

In general, this is a good feature because it’s helps your web application’s scalability. How?

By default, the ASPxGridView stores data in memory for quick access. This avoids repeated database calls when performing various operations that don't require reloading data (e.g. rearranging or hiding columns). Therefore, it increases your Web application’s scalability and the individual operations will be quicker because there's no database access happening in that particular cycle.

As a bonus for the inquisitive minds: The DevExpress ASP.NET controls store items in memory by using our own custom callback state. It’s similar to the Microsoft ViewState, except that the DevExpress CallbackState lives between callbacks and not postbacks. Want to learn more? Check out the “Speed up your page loads with a lighter ViewState” blog post.

When To Set It To False?

To disable data caching, set the EnableRowsCache option to false. This can be useful, for instance, when the ASPxGridView displays real-time data. It's also recommended that you disable this option when binding to data created at runtime, because calling the DataBind() method will always reload data from the server.

ASPxGridView's EnableRowsCache Property

Coming Soon To ASPxPivotGrid

The ASPxPivotGrid can have a large amount of data even between callbacks. For these scenarios, you may not want to store that info in memory. Now you have the option to disable row caching in the ASPxPivotGrid as well.

The ASP.NET team has just added the EnableRowsCaches feature to the ASPxPivotGrid. The option will be officially available in an upcoming major release.

DevExpress Platinum Sponsor at Microsoft PDC

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.