Export (0) Print
Expand All

Sorting Data in the Windows Forms DataGridView Control

By default, users can sort the data in a DataGridView control by clicking the header of a text box column. You can modify the SortMode property of specific columns to allow users to sort by other column types when it makes sense to do so. You can also sort the data programmatically by any column, or by multiple columns.

Column Sort Modes in the Windows Forms DataGridView Control

Describes the options for sorting data in the control.

How to: Set the Sort Modes for Columns in the Windows Forms DataGridView Control

Describes how to enable users to sort by columns that are not sortable by default.

How to: Customize Sorting in the Windows Forms DataGridView Control

Describes how to sort data programmatically and how to customize sorting by using the DataGridView.SortCompare event or by implementing the IComparer interface.

DataGridView

Provides reference documentation for the DataGridView control.

DataGridView.Sort

Provides reference documentation for the Sort method.

DataGridViewColumn.SortMode

Provides reference documentation for the SortMode property.

DataGridViewColumnSortMode

Provides reference documentation for the DataGridViewColumnSortMode enumeration.

Show:
© 2014 Microsoft