'Declaration Public Event ColumnSorting As EventHandler(Of SortingCancellableEventArgs)
public event EventHandler<SortingCancellableEventArgs> ColumnSorting
The event handler receives an argument of type SortingCancellableEventArgs containing data related to this event. The following SortingCancellableEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from Infragistics.CancellableEventArgs) | |
Column (Inherited from Infragistics.Controls.Grids.CancellableColumnEventArgs) | The CancellableColumnEventArgs.Column that this event was triggered for. |
NewSortDirection | Gets the SortDirection as it will be applied. |
PreviousSortDirection | Gets the SortDirection prior to the change being made. |
Private Sub MyGrid_ColumnSorting(ByVal sender As System.Object, ByVal e As SortingCancellableEventArgs) 'If the column is fixed to the left, do not allow that column to be sorted If e.Column.IsFixed = FixedState.Left Then System.Diagnostics.Debug.WriteLine("Cannot sort on fixed columns") e.Cancel = True Return End If System.Diagnostics.Debug.WriteLine(e.Column.Key + " Column sorted from " + e.PreviousSortDirection.ToString() + " to " + e.NewSortDirection.ToString()) End Sub
private void MyGrid_ColumnSorting(object sender, SortingCancellableEventArgs e) { // If the column is fixed to the left, do not allow that column to be // sorted if (e.Column.IsFixed == FixedState.Left) { System.Diagnostics.Debug.WriteLine("Cannot sort on fixed columns"); e.Cancel = true; return; } System.Diagnostics.Debug.WriteLine(e.Column.Key+" Column sorted from: " + e.PreviousSortDirection + "\n to: " + e.NewSortDirection); }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2