Tab

ASPxCardView.EnableCardsCache Property

Gets or sets whether data caching is enabled.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

[DefaultValue(true)]
public bool EnableCardsCache { get; set; }
<DefaultValue(True)>
Public Property EnableCardsCache As Boolean

Property Value

Type Default Description
Boolean

true

true, to enable data caching; otherwise, false.

Remarks

By default, the ASPxCardView 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). As a result, this increases the Web application scalability.

To disable data caching, set the EnableCardsCache option to false. This can be useful in the following cases:

  • The ASPxCardView displays real-time data.
  • Binding the ASPxCardView control to data created at runtime. The card view always reloads data from the server when you call the DataBind() method.
  • The ASPxCardView control uses the CardViewBinaryImageColumn. Setting the EnableCardsCache property to false reduces web page loading time.
NOTE

If you use custom objects that utilize a referenced association, the ASPxCardView tries to cache references as well. 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 ASPxCardView.EnableCardsCache property. This solution is acceptable when the page doesn't have several grids, and in most cases, this 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

Examples

The following example demonstrates how to show a complex property value in DataItemTemplate of a column that uses BindingExpressions.

View Example

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}