Back to Devexpress

Events to Format Data

aspnet-114472-components-card-view-concepts-data-formatting-formatting-using-events.md

latest830 B
Original Source

Events to Format Data

  • Dec 17, 2020

ASPxCardView includes the ASPxCardView.CustomColumnDisplayText event, which enables you to provide custom display text for individual data cells.

Example

The following example displays the “empty” string within the Discount column’s cells if they contain zero values.

The image below shows the result:

csharp
protected void CardView_CustomColumnDisplayText(object sender, ASPxCardViewColumnDisplayTextEventArgs e) {
        if (e.Column.FieldName != "Discount") return;
        if (Convert.ToInt32(e.Value) == 0)
            e.DisplayText = "empty";
    }