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

How to: Provide Custom Display Text for Data Cells

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

The image below shows the result:


protected void ASPxGridView2_CustomColumnDisplayText(object sender,
    DevExpress.Web.ASPxGridViewColumnDisplayTextEventArgs e) {
    if (e.Column.FieldName != "UnitsOnOrder") return;
    if (Convert.ToInt32(e.Value) == 0)
        e.DisplayText = "empty";