How to: Enable Column Reordering in the Windows Forms DataGridView Control Using the Designer

When viewing data displayed in a Windows Forms DataGridView control, users sometimes want to compare the values in specific columns. This can be inconvenient if the columns are widely separated in the control, especially if users must scroll back and forth horizontally in order to see all the columns they are interested in. You can make the task of comparing column values easier by enabling your users to reorder the columns. When you enable column reordering, users can move a column to a new position by dragging the column header with the mouse.

The following procedure requires a Windows Application project with a form containing a DataGridView control. For information about setting up such a project, see How to: Create a Windows Forms application project and How to: Add Controls to Windows Forms.

To enable column reordering

  • Click the designer actions glyph (Small black arrow) on the upper-right corner of the DataGridView control, and then select Enable Column Reordering.

See also