I have a DataGridView with a checkbox column.
Now I want to loop through all rows, with an active checkbox and print out the IdUser and True.
foreach (DataGridViewRow row in userDataGridView.Rows)
{
if (row.Cells[5].Value.ToString() == "True")
{
MessageBox.Show(row.Cells[0].Value.ToString() + " - " + row.Cells[5].Value.ToString());
}
}
In this example the row with the IdUser 17 is the last selected one.
I don't know why, but I just see entry 15 as the last one. 17 is not shown any more...
Can anybody help?
Regards Lars

Aucun commentaire:
Enregistrer un commentaire