Skip to main content
A newer version of this page is available. .

TreeListNode.GetValue(String) Method

Returns the value of the specified cell within the current node.

Namespace: DevExpress.Web.ASPxTreeList

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

Declaration

public virtual object GetValue(
    string fieldName
)

Parameters

Name Type Description
fieldName String

A String value that specifies the name of the data source field.

Returns

Type Description
Object

An object that represents the specified cell’s value.

Remarks

To specify node values, use the TreeListNode.SetValue method.

Example

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);
    }
} 

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetValue(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also