Skip to main content

TreeListColumnDisplayTextEventArgs.DisplayText Property

Enables you to set a custom text for the cell currently being processed.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public string DisplayText { get; set; }

Property Value

Type Description
String

A String value that specifies the custom cell’s display text. The default value is null.

Remarks

Initially, the DisplayText property returns null. Assign custom text to the DisplayText property to display it in the processed cell.

To get the cell’s edit value, use the TreeListColumnDisplayTextEventArgs.Value property.

Example

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

The image below shows the result:

ASPxTreeList-CustomColumnDisplayText

protected void ASPxTreeList1_CustomColumnDisplayText(object sender, DevExpress.Web.ASPxTreeList.TreeListColumnDisplayTextEventArgs e)
{
    if (e.Column.FieldName != "UnitsOnOrder") return;
    if (Convert.ToInt32(e.Value) == 0)
        e.DisplayText = "empty";
}
See Also