CardViewSettings.CustomColumnDisplayText Property

Enables custom display text to be provided to any cell.

Namespace: DevExpress.Web.Mvc

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

Declaration

public ASPxCardViewColumnDisplayTextEventHandler CustomColumnDisplayText { get; set; }
Public Property CustomColumnDisplayText As ASPxCardViewColumnDisplayTextEventHandler

Property Value

Type Description
ASPxCardViewColumnDisplayTextEventHandler

An ASPxCardViewColumnDisplayTextEventHandler delegate method allowing you to implement custom processing.

Remarks

Use the CustomColumnDisplayText property to provide custom display text for any cell. This property is in effect both for bound and unbound columns. The card view uses the CustomColumnDisplayText property's value when you print or export the card view.

Use the ASPxGridColumnDisplayTextEventArgs.DisplayText parameter to provide custom display text. To get the current cell value, use the ASPxGridColumnDisplayTextEventArgs.Value parameter.

Use the CustomColumnDisplayText property to provide custom display text for any cell in two cases.

Note

The CustomColumnDisplayText property is not in effect for template columns.

Examples

This example demonstrates how to display the "empty" string within the "Units On Order" column's cells if they contain zero values.

@Html.DevExpress().CardView( 
    settings => {
        settings.Name = "CardView";
        settings.CustomColumnDisplayText = (sender, e) =>
        {
            if (e.Column.FieldName != "UnitsOnOrder") return;
            if (Convert.ToInt32(e.Value) == 0)
                e.DisplayText = "empty";
        };
}).Bind(Model).GetHtml()
See Also