ASPxGridView.EnableRowsCache Property
Gets or sets whether the grid caches data.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.2.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | **true** | true, to cache data; otherwise, false. |
Remarks
By default, the ASPxGridView stores data in memory for quick access. This avoids repeated database calls when you perform various operations that don’t require to reload data (e.g., rearrange or hide columns). As a result, this increases the Web application scalability.
To disable data caching, set the EnableRowsCache option to false. This can be useful in the following cases:
- The ASPxGridView displays real-time data.
- Binding the ASPxGridView control to data created at runtime. The grid view always reloads data from the server when you call the DataBind() method.
- The ASPxGridView control uses the GridViewDataBinaryImageColumn. Setting the EnableRowsCache property to false reduces web page loading time.
<dx:ASPxGridView ID="ASPxGridView1" runat="server" EnableRowsCache="False" ...
Note
The EnableRowsCache option must be disabled when using custom grouping intervals defined via the GridViewDataColumnSettings.GroupInterval property.
Note
If you use custom objects that utilize a referenced association, the ASPxGridView tries to cache references too. The serialization of a custom object is performed by the ToString method and is performed smoothly. But the object deserialization (restoration from String to object) could be raised with an exception:
TypeConverter cannot convert from System.String.
One solution is to turn off the ASPxGridView.EnableRowsCache
property. This solution is acceptable when the page doesn’t have several grids, and in most cases doesn’t affect page performance significantly.
However, you can implement a custom TypeConverter derived class that can convert from the String type correctly. To learn more, see the Code Central example: How to implement a custom TypeConverter class for an XPO object
Concept
Knowledge-Base Article
Online Examples
How to implement optimistic concurrency for the update operation
How to implement a custom TypeConverter class for an XPO object