DataViewBase.MoveColumnTo(ColumnBase, Int32, HeaderPresenterType, HeaderPresenterType, MergeGroupPosition) Method
Moves the specified column to the specified position.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v19.1.Core.dll
Declaration
public void MoveColumnTo(
ColumnBase source,
int newVisibleIndex,
HeaderPresenterType moveFrom,
HeaderPresenterType moveTo,
MergeGroupPosition mergeGroupPosition = MergeGroupPosition.None
)
Parameters
Name | Type | Description |
---|---|---|
source | ColumnBase | A ColumnBase object that represents the source column. |
newVisibleIndex | Int32 | An integer value that specifies the column’s new position among the columns displayed within the destination area. |
moveFrom | HeaderPresenterType | A HeaderPresenterType enumeration value that specifies the grid’s area (the header panel, group panel or column chooser) in which the source column is currently displayed. |
moveTo | HeaderPresenterType | A HeaderPresenterType enumeration value that specifies the grid’s area (the header panel, group panel or column chooser) to which the source column is moved. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
mergeGroupPosition | MergeGroupPosition | 0 | A MergeGroupPosition enumeration value that specifies to which column the current column should be merged. |
Remarks
The following example shows how to group data by the ‘Unit Price’ column values using the MoveColumnTo method.
grid.View.MoveColumnTo(grid.Columns["UnitPrice"], 0,
DevExpress.Xpf.Grid.HeaderPresenterType.Headers,
DevExpress.Xpf.Grid.HeaderPresenterType.GroupPanel,
DevExpress.Xpf.Grid.MergeGroupPosition.Right);