lundi 3 août 2015

Set Selected DataGridView columns to true

I can not figure out how to solve this problme although it should be very simple. I have a DataGridView with one column containing CheckBoxes. Now I loop through all selected rows and want to turn the CheckBox to true which is currently in my loop but somehow he just turns only the one to true which is selected first.

foreach (DataGridViewRow row in dataGridView1.SelectedRows)
{
 dataGridView1.SelectedRows[dataGridView1.CurrentRow.Index].Cells[0].Value = true;
}

I also tried other solutions but I can't get it working. Sorry if this question should be too simple!




Aucun commentaire:

Enregistrer un commentaire