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

DataViewBase.MoveColumnTo(ColumnBase, Int32, HeaderPresenterType, HeaderPresenterType, MergeGroupPosition) Method

Moves the specified column to the specified position.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public void MoveColumnTo(
    ColumnBase source,
    int newVisibleIndex,
    HeaderPresenterType moveFrom,
    HeaderPresenterType moveTo,
    MergeGroupPosition mergeGroupPosition = MergeGroupPosition.None
)

#Parameters

Name Type Description
source ColumnBase

A column.

newVisibleIndex Int32

The column’s new position between columns in the destination area.

moveFrom HeaderPresenterType

The grid’s area (the header panel, group panel or column chooser) in which the column is currently displayed.

moveTo HeaderPresenterType

The grid’s area (the header panel, group panel or column chooser) to which the column is moved.

#Optional Parameters

Name Type Default Description
mergeGroupPosition MergeGroupPosition None

The position where the current column should be merged.

#Remarks

The following example shows how to use the MoveColumnTo method to group data by the ‘Unit Price’ column values:

grid.View.MoveColumnTo(grid.Columns["UnitPrice"], 0,
    DevExpress.Xpf.Grid.HeaderPresenterType.Headers,
    DevExpress.Xpf.Grid.HeaderPresenterType.GroupPanel,
    DevExpress.Xpf.Grid.MergeGroupPosition.Right);
See Also