A newer version of this page is available. Switch to the current version.

GridBandColumnCollection.MoveTo(Int32, BandedGridColumn) Method

Moves a column to a new position within the current band.

Namespace: DevExpress.XtraGrid.Views.BandedGrid

Assembly: DevExpress.XtraGrid.v19.2.dll


public virtual void MoveTo(
    int newIndex,
    BandedGridColumn column
Public Overridable Sub MoveTo(
    newIndex As Integer,
    column As BandedGridColumn


Name Type Description
newIndex Int32

An integer value specifying the target position (a zero-based index within the collection). A negative value to remove the column.

column BandedGridColumn

A BandedGridColumn object representing the column to be moved.


If the newIndex parameter exceeds the number of elements in the collection, the column is moved to the end of the collection.

Calling the MoveTo method does nothing if the column doesn't belong to the collection.

When you move a column forward (i.e., when the newIndex is higher than the current index), the column is actually moved to the position specified by the newIndex - 1 value. When you move a column backward, the column is moved to the position specified by the newIndex value.

See Also