mggSoft mggSoft - 4 months ago 60
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


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.