Skip to main content
A newer version of this page is available. .

How to: Provide Custom Display Text for Data Cells

This example demonstrates how to display the “empty” string within the Discount column’s cells if they contain zero values.

The image below shows the result:

ASPxCardView_CustomColumnDisplayText

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