Usuario
Recorrer un checkbox dentro de un datagridview

Pregunta
-
Todas las respuestas
-
Hola,
¿Intentaste hacerlo de otra manera?
foreach (GridViewRow fila in Mostrar.Rows) { if (Convert.ToBoolean(fila.Cells[0].Value)) { DataRow dr = dt.NewRow(); dr["Id"] = fila.Cells[1].Text; list.Add(dr); } }
Si la solución propuesta atendió su consulta no olvide marcarla como respuesta.
Willams Morales
Arequipa - PERÚ -
-
foreach (DataGridViewRow fila in Mostrar.Rows) { if (fila.IsNewRow) continue; DataGridViewCheckBoxCell check = (DataGridViewCheckBoxCell)fila.Cells[0]; if ((check.ValueType == typeof(bool) && (bool)check.Value) || (check.ValueType == typeof(CheckState) && (CheckState)check.Value == CheckState.Checked)) { //DataRow dr = dt.NewRow(); //dr["Id"] = fila.Cells[1].Text; //list.Add(dr); MessageBox.Show(""); } }
- Propuesto como respuesta Karen MalagónModerator lunes, 16 de febrero de 2015 17:33
-