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

TreeListCustomUnboundColumnDataEventArgs.Column Property

Gets the processed column.

Namespace: DevExpress.Web.ASPxTreeList

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

Declaration

public TreeListDataColumn Column { get; }
Public ReadOnly Property Column As TreeListDataColumn

Property Value

Type Description
TreeListDataColumn

A TreeListDataColumn object representing the column.

Examples

Assume that ASPxTreeList is bound to an "Order Details" data table (NWind data base), which contains "UnitPrice", "Quantity" and "Discount" fields. There is no field that represents the total sum, as this can be calculated manually as follows: UnitPrice*Quantity*(1-Discount). This example shows how to add an unbound column to the ASPxTreList control to represent the total sum of an order.

The image below shows the result.

ASPxTreeList-CustomUnboundColumnData

protected void TreeList_CustomUnboundColumnData(object sender, TreeListCustomUnboundColumnDataEventArgs e)
{
    if (e.Column.FieldName == "Total")
    {
        decimal unitPrice = Convert.ToDecimal(e.Node.GetValue("UnitPrice"));
        decimal quantity = Convert.ToDecimal(e.Node.GetValue("Quantity"));
        decimal discount = Convert.ToDecimal(e.Node.GetValue("Discount"));
        e.Value = unitPrice * quantity * (1 - discount);
    }
} 
See Also