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

GridLevelNodeCollection.Add(String, BaseView) Method

Creates a new node and appends it to the current collection.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v18.2.dll

Declaration

public GridLevelNode Add(
    string relationName,
    BaseView template
)

Parameters

Name Type Description
relationName String

A string specifying the name of the relationship that the new node will represent. This parameter’s value is used to initialize the node’s GridLevelNode.RelationName property.

template BaseView

A BaseView descendant representing the pattern View to associate with the specified relationship. This parameter’s value is used to initialize the node’s GridLevelNode.LevelTemplate property.

Returns

Type Description
GridLevelNode

A GridLevelNode object representing the created node.

Remarks

The Add method creates and initializes a new node with the specified relationship name and pattern View. The node is then appended to the collection. The order of the nodes in the collection determines the order in which the corresponding master-detail relationships will be displayed in the XtraGrid. To add a node at a specific position use the GridLevelNodeCollection.Insert method.

If the collection already contains a node whose GridLevelNode.RelationName property matches the relationName parameter’s value, then a new node will not be created. Instead the existing node’s GridLevelNode.LevelTemplate property will be set to the View provided by the template parameter.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(String, BaseView) 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