Naeem Khan

Naeem Khan

  • 975
  • 802
  • 800k

Multipal Selection checkboxes in DataGridView

Sep 11 2009 7:38 AM
hi, i have one datagridview . which is bind from my database (Mysql). i want checkboxes in dgv for multipal select. i got chk boxes in dgv but i dont know why its showing me Error. here is code for it. private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { for (int i = 0; i < dataGridView1.Rows.Count;i++) { error line// if { ((bool)this.dataGridView1.Rows[i].Cells["Select"].Value == true) { selectedCheckBox.Add(i); } } } // this is Error Object reference not set to an instance of an object. plz help me . thanks in Advance

Answers (4)