Built-in Card Caching
- 2 minutes to read
ASPxCardView includes the ASPxCardView.EnableCardsCache property, which allows you to enable or disable built-in card data caching.
By default, the ASPxCardView.EnableCardsCache property is set to true and ASPxCardView stores its content in the grid's cache memory for quick access. If the request to the server is not instantiated by ASPxCardView, or if the operation does not require data reload (e.g., when you rearrange or hide columns), then ASPxCardView will load data from the cache. The result is that it increases the web application's scalability and improves performance because the database does not need to be accessed.
If you need to disable caching in some cases (e.g., when ASPxCardView displays real-time data), set the ASPxCardView.EnableCardsCache option to false. You should also disable this option when binding to data created at runtime, because data is always reloaded when you call the DataBind method.
If you use custom objects that utilize a referenced association, ASPxCardView also attempts to cache references. The ToString method successfully executes the serialization of a custom object, but object deserialization (restoration from String to object) may raise an exception:
TypeConverter cannot convert from System.String.
One solution is to disable the ASPxCardView.EnableCardsCache property. This solution is acceptable when the page has only one grid, and if this action does not significantly affect performance.
Alternatively, you can implement a custom TypeConverter derived class that can convert from the String type correctly. To learn more, see the following example in our Support Center: How to implement a custom TypeConverter class for an XPO object
<dx:ASPxCardView ID="ASPxCardView1" runat="server" EnableCardsCache="False" ...
For more information, see the following KB article: ASPxGridView Row Cache.