title: Unable to select checkbox in datagridview in c#
body: <p>I have the following code in my c# windows application where I am trying to insert a checkbox corresponding to each row. When i click a button outside the selected rows should be deleted. But i am not able to select the checkbox using this code. </p>
  
  <pre><code>dataGridView1.ReadOnly = false;
  OleDbCommand SQLQuery = new OleDbCommand();
  DataTable data = null;
  dataGridView1.DataSource = null;
  SQLQuery.Connection = null;
  OleDbDataAdapter dataAdapter = null;
  dataGridView1.Columns.Clear(); 
  
  SQLQuery.CommandText = sqlQueryString;
  SQLQuery.Connection = database;
  data = new DataTable();
  dataAdapter = new OleDbDataAdapter(SQLQuery);
  dataAdapter.Fill(data);
  dataGridView1.DataSource = data;
  dataGridView1.AllowUserToAddRows = true; // remove the null line
  dataGridView1.ReadOnly = true;
  dataGridView1.Columns[0].Visible = true;
  dataGridView1.Columns[1].Width = 340;
  dataGridView1.Columns[2].Width = 55;          
  // insert checkbox button into datagridview
  deleteck = new DataGridViewCheckBoxColumn();
  deleteck.HeaderText = "delete";     
  deleteck.Width = 80;
  deleteck.ReadOnly = false;         
  dataGridView1.Columns.Insert(0, deleteck); 
  </code></pre>
  
  <p>Could anyone help me to figure out what's wrong here?</p>