Guest User

Untitled

a guest
Jul 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. dataGridView1.DataSource = bs;
  2. dataGridView1.ReadOnly = true;
  3. dataGridView1.CurrentCellChanged += delegate
  4. {
  5. DataGridViewRow row = dataGridView1.CurrentRow;
  6. bool readOnly = row == null ||
  7. row.Index != dataGridView1.NewRowIndex;
  8. dataGridView1.ReadOnly = readOnly;
  9. };
Add Comment
Please, Sign In to add comment