Export (0) Print
Expand All

How to: Set the Selection Mode of the Windows Forms DataGridView Control

The following code example demonstrates how to configure a DataGridView control so that clicking anywhere within a row automatically selects the entire row, and so that only one row at a time can be selected.

this.dataGridView1.SelectionMode =
this.dataGridView1.MultiSelect = false;

This example requires:

Community Additions

© 2015 Microsoft