Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GridLevelNodeCollection.Insert(Int32, String, BaseView) Method

Creates a node and inserts it at a specific point within the collection.

Namespace: DevExpress.XtraGrid

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

public GridLevelNode Insert(
    int position,
    string relationName,
    BaseView template
)

#Parameters

Name Type Description
position Int32

An integer value representing the zero-based index at which the new node should be added.

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 Insert method creates and initializes a new node with the specified relationship name and pattern View. The node is then inserted at the specified index in 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.

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.

See Also