Pat Tum

Pat Tum

  • NA
  • 16
  • 0

DataGridView Checkbox Issue

Mar 8 2007 1:04 PM
Hello Gentleman, I am trying to use a checkbox column in the DataGridView to identify a column so that I can extract a line of information from it to use in an SQL parameter. However, I can not find a simply way to identify when the column is in a checked state. The code below is producing the error : Operator '==' cannot be applied to operands of type 'object' and 'bool' This does not make sense to me, since the same code is used (with a single equal sign) to set the checked state of the box. Any assistance would be greatly appreciated...Pat int count = dataGridViewEMail.Rows.Count; string mailId = ""; for (int i = 0; i < count; i++) { if (dataGridViewEMail.Rows[i].Cells["Delete"].Value == true) { mailId = dataGridViewEMail["Id", i].ToString(); } } Thank You..:-)

Answers (2)