Skip to main content

CardViewSettings.EnableCardsCache Property

Gets or sets whether data caching is enabled.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public bool EnableCardsCache { get; set; }

Property Value

Type Description
Boolean

true, to enable data caching; otherwise, false.

Remarks

By default, the CardView extension stores data in memory for quick access. This avoids repeated database calls when performing various operations that don’t require reloading data. As a result, this increases the Web application scalability.

To disable data caching, set the EnableCardsCache option to false. This can be useful, for instance, when the CardView displays real-time data.

Note

If you use custom objects that utilize a referenced association, the CardView 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 EnableCardsCache 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

See Also