The requested page is not available for the requested platform. You are viewing the content for Default platform.

GridViewSettings.CustomColumnDisplayText Property

Enables you to provide custom display text for any cell.

Namespace: DevExpress.Web.Mvc

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

Declaration

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

Property Value

Type Description
ASPxGridViewColumnDisplayTextEventHandler

A ASPxGridViewColumnDisplayTextEventHandler 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 grid uses the CustomColumnDisplayText property's value when you print or export the grid.

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.

Online Example

GridView - How to filter dates by the month

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().GridView(settings => {
    settings.Name = "GridView1";    
    settings.KeyFieldName = "ID";
    ...
    settings.CustomColumnDisplayText = (sender, e) =>
    {
        if (e.Column.FieldName != "UnitsOnOrder") return;
        if (Convert.ToInt32(e.Value) == 0)
            e.DisplayText = "empty";
    };
}).Bind(Model).GetHtml()
See Also