windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumncollection-dot-add-x28-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-x29.md
Adds the specified column to the end of the collection.
Namespace : DevExpress.XtraGrid.Columns
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public virtual int Add(
GridColumn column
)
Public Overridable Function Add(
column As GridColumn
) As Integer
| Name | Type | Description |
|---|---|---|
| column | GridColumn |
The column to add to the collection.
|
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the position of the column within the collection.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(GridColumn) 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.
winforms-grid-tokenedit-in-unbound-column/CS/Form1.cs#L57
col.OptionsColumn.AllowEdit = true;
gridView.Columns.Add(col);
gridView.CustomUnboundColumnData += OnGridViewCustomUnboundColumnData;
winforms-grid-add-radio-group-column/CS/Helper/GridRadioGroupColumnHelper.cs#L86
RadioGroupColumn.FieldName = "RadioGroupColumn";
_GridView.Columns.Add(RadioGroupColumn);
RadioGroupColumn.Visible = true;
winforms-grid-tokenedit-in-unbound-column/VB/Form1.vb#L54
col.OptionsColumn.AllowEdit = True
gridView.Columns.Add(col)
AddHandler gridView.CustomUnboundColumnData, AddressOf OnGridViewCustomUnboundColumnData
winforms-grid-display-icons-in-data-cells/VB/Form1.vb#L193
gridControl1.RepositoryItems.Add(buttonEdit)
gridView1.Columns.Add(New GridColumn() With {.Caption = "Unbound Column", .FieldName = "UnboundColumn", .UnboundDataType = GetType(Object), .Visible = True})
Dim pictureEditUnbound As RepositoryItemPictureEdit = TryCast(gridControl1.RepositoryItems.Add("PictureEdit"), RepositoryItemPictureEdit)
winforms-grid-add-radio-group-column/VB/Helper/GridRadioGroupColumnHelper.vb#L87
RadioGroupColumn.FieldName = "RadioGroupColumn"
_GridView.Columns.Add(RadioGroupColumn)
RadioGroupColumn.Visible = True
See Also