This documentation is archived and is not being maintained.
How to: Set the Selection Mode of the Windows Forms DataGridView Control
.NET Framework 3.0
The following code example demonstrates how to configure acontrol so that clicking anywhere within a row automatically selects the entire row, and so that only one row at a time can be selected.
Compiling the Code
This example requires:
A DataGridView control named dataGridView1.
References to theand assemblies.