Back to Devexpress

ColumnView.ColumnChanged Event

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnview-6bca884a.md

latest2.6 KB
Original Source

ColumnView.ColumnChanged Event

Fires when changing a column’s properties.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DXCategory("Property Changed")]
public event EventHandler ColumnChanged
vb
<DXCategory("Property Changed")>
Public Event ColumnChanged As EventHandler

Event Data

The ColumnChanged event's data class is EventArgs.

Remarks

The ColumnChanged event is raised when the properties affecting column data representation are changed. The column whose properties have changed is identified by the event’s sender parameter. The event is used internally by Views. Generally, you will have no need to handle it in your own application.

csharp
private void gridView1_ColumnChanged(object sender, EventArgs e) {
    GridColumn column = sender as GridColumn;
    MessageBox.Show("The " + column.Caption + " column has changed");
}
vb
Private Sub gridView1_ColumnChanged(ByVal sender As Object, ByVal e As EventArgs) _
    Handles gridView1.ColumnChanged
    Dim column As GridColumn = TryCast(sender, GridColumn)
    MessageBox.Show("The " & column.Caption & " column has changed")
End Sub

You may need to respond to sorting or grouping a View against specific column values. For this purpose, handle the ColumnView.EndSorting and ColumnView.EndGrouping events respectively.

See Also

GridColumn

EndGrouping

EndSorting

ColumnView Class

ColumnView Members

DevExpress.XtraGrid.Views.Base Namespace