mggSoft mggSoft -4 years ago 325
C# Question

Disable DataGridView except the scroll

How I can configure a datagridview so that the user can only move through the rows and use the scroll, and nothing else...
If I disable the grid not allow me to use the scroll

Answer Source

Set your datagridview to read-only, this will disable any edits.

dataGridView1.ReadOnly = true;

And inside your handlers, do :

void dataGridView1_DoubleClick(object sender, EventArgs e)
     if (dataGridView1.ReadOnly == true)

     // .. whatever code you have in your handler...

Even if the user double-clicks on the grid, nothing will happen.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download