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

ColumnView.ColumnPositionChanged Event

Allows you to respond to changing a column’s position within the View.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.2.dll

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

#Declaration

[DXCategory("Property Changed")]
public event EventHandler ColumnPositionChanged

#Event Data

The ColumnPositionChanged event's data class is EventArgs.

#Remarks

The column whose position has been changed is specified by the event’s sender parameter. To get the column’s position among visible columns in the Column Header Panel, use the GridColumn.VisibleIndex property.

The ColumnPositionChanged event also fires in the following cases:

using DevExpress.XtraGrid.Columns;

private void gridView1_ColumnPositionChanged(object sender, EventArgs e) {
    GridColumn column = sender as GridColumn;
    MessageBox.Show(column.VisibleIndex.ToString());
}

To identify the column’s position within the group panel, use the GridColumn.GroupIndex property.

See Also