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

GridColumnCollection.Insert(Int32) Method

Creates a new column and adds it to the specified position within the collection.

Namespace: DevExpress.XtraGrid.Columns

Assembly: DevExpress.XtraGrid.v24.2.dll

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

#Declaration

public virtual GridColumn Insert(
    int index
)

#Parameters

Name Type Description
index Int32

A zero-based integer specifying the new column’s position within the collection. If negative, the column is inserted as the first element. If it exceeds the last available index, the column is appended to the collection.

#Returns

Type Description
GridColumn

A GridColumn object representing the column inserted.

#Remarks

Use the Insert method to add a new column with default settings to the specified position within the collection. Note that the new column has no caption, is not bound to any data source field and has other settings cleared. Thus, you need to customize the method’s return object to provide proper column settings.

Please refer to the Columns topic for details.

See Also