DataGridView.OnSortCompare(DataGridViewSortCompareEventArgs) Method

Definition

Raises the SortCompare event.

protected:
 virtual void OnSortCompare(System::Windows::Forms::DataGridViewSortCompareEventArgs ^ e);
protected virtual void OnSortCompare (System.Windows.Forms.DataGridViewSortCompareEventArgs e);
abstract member OnSortCompare : System.Windows.Forms.DataGridViewSortCompareEventArgs -> unit
override this.OnSortCompare : System.Windows.Forms.DataGridViewSortCompareEventArgs -> unit
Protected Overridable Sub OnSortCompare (e As DataGridViewSortCompareEventArgs)

Parameters

Remarks

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnSortCompare method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnSortCompare(DataGridViewSortCompareEventArgs) in a derived class, be sure to call the base class's OnSortCompare(DataGridViewSortCompareEventArgs) method so that registered delegates receive the event.

Applies to

See also