protected override void OnColumnClick(ColumnClickEventArgs e)
{
// Determine if clicked column is already the column that is being sorted.
if (e.Column == _columnSorter.SortColumn)
{
// Reverse the current sort direction for this column.
if (_columnSorter.Order == SortOrder.Ascending)
{
_columnSorter.Order = SortOrder.Descending;
}
else
{
_columnSorter.Order = SortOrder.Ascending;
}
}
else
{
// Set the column number that is to be sorted; default to ascending.
_columnSorter.SortColumn = e.Column;
_columnSorter.Order = SortOrder.Ascending;
}
if (_numericSortOrders.Contains(e.Column))
_columnSorter.NumericSort = true;
// Perform the sort with these new sort options.
this.Sort();
base.OnColumnClick(e);
}