Skip to main content

TreeListSettings.CustomColumnDisplayText Property

Enables custom display text to be provided for any cell.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public TreeListCustomColumnDisplayTextEventHandler CustomColumnDisplayText { get; set; }

Property Value

Type Description
TreeListCustomColumnDisplayTextEventHandler

A delegate method that allows you to provide custom display text for any cell.

Remarks

The CustomColumnDisplayText event can be used to provide custom display text for any cell. This event is fired for both bound and unbound columns.

Initially, the DisplayText parameter returns null. To provide custom display text, assign the required string to this parameter. To get the current cell value, use the Value parameter.

The CustomColumnDisplayText event fires in two cases.

  • When the control hierarchy is being built.
  • When a grid is sorted by display text (the SortMode property is set to DisplayText).

Note

The CustomColumnDisplayText event should not be handled for template columns.

@Html.DevExpress().TreeList(settings => {
    settings.Name = "treeList";
    ...
    settings.CustomColumnDisplayText = (s, e) =>
    {
        if (e.Column.FieldName != "Budget") return;
        if (Convert.ToInt32(e.Value) > 0)
            e.DisplayText = "sample text";
    };

}).Bind(Model).GetHtml()
See Also