DataGridView.SortBy Method

Name Parameters Description
SortBy(GridColumn) column

Sorts data by values of the specified column in ascending order.

SortBy(GridColumn, ColumnSortOrder) column, sortOrder

Sorts data by values of the specified column in the specified order.

SortBy(GridColumn, ColumnSortOrder, Int32) column, sortOrder, sortIndex

Sorts data by values of the specified column in the specified order, and places the column at the specified position among the sorted columns.

SortBy(String) fieldName

Sorts data by values of the column bound to the specified data field in the ascending order.