aspnetmvc-devexpress-dot-web-dot-mvc-dot-cardviewsettings-98759a90.md
Enables custom display text to be provided to any cell.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public ASPxCardViewColumnDisplayTextEventHandler CustomColumnDisplayText { get; set; }
Public Property CustomColumnDisplayText As ASPxCardViewColumnDisplayTextEventHandler
| Type | Description |
|---|---|
| ASPxCardViewColumnDisplayTextEventHandler |
An ASPxCardViewColumnDisplayTextEventHandler delegate method allowing you to implement custom processing.
|
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.
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