TreeList.AppendNode(Object, Int32, Int32, Int32, Int32) Method

Appends a new node with the specified settings.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v20.1.dll

Declaration

public virtual TreeListNode AppendNode(
    object nodeData,
    int parentNodeId,
    int imageIndex,
    int selectImageIndex,
    int stateImageIndex
)
Public Overridable Function AppendNode(
    nodeData As Object,
    parentNodeId As Integer,
    imageIndex As Integer,
    selectImageIndex As Integer,
    stateImageIndex As Integer
) As TreeListNode

Parameters

Name Type Description
nodeData Object

An array of values or a DataRow object, used to initialize the created node's cells.

parentNodeId Int32

An integer value specifying the parent node's identifier.

imageIndex Int32

A zero-based index of the image displayed within the node.

selectImageIndex Int32

A zero-based index of the image displayed within the node when it is focused or selected.

stateImageIndex Int32

An integer value that specifies the index of the node's state image.

Returns

Type Description
TreeListNode

A TreeListNode object representing the added node.

Remarks

Use the AppendNode method to append a new node to the specified node's child collection. Use the parentNodeId parameter to specify the parent node by its identifier. Node identifiers are returned by the TreeListNode.Id property. To add a node at the root level, the parentNodeId parameter must be set to the value of the TreeList.RootValue property.

The nodeData parameter specifies data for the columns of the node that is to be created. This parameter value can be an array of values or a DataRow object. The number and order of items in the array/DataRow object must match the number and order of Tree List columns.

Refer to the Nodes topic to learn more.

See Also