The GridView.Sorting event occurs when a hyperlink to sort a column is clicked but before the GridView handles the sorting operation. This allows custom code to run or cancel the sorting. The event handler receives a GridViewSortEventArgs object containing sort expression and direction. To cancel sorting, set GridViewSortEventArgs.Cancel to true. The example demonstrates handling the Sorting event to perform custom sorting when data is bound to a DataTable and to cancel sorting by address.