mardi 17 octobre 2017

How to check checkbox if the datagridview column value="True"

i want to set my datagridview checkbox checked or unchecked according to the datagridview column value if datagridview column[3] value="true" checkbox checked if datagridview column[3] value="false" checkbox unchecked

 my code as follows;
 foreach (DataGridViewRow r in dataGridView3.Rows)
 {

 DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)r.Cells[0];
 string inceleme = r.Cells[3].Value.ToString();

 if (inceleme=="Evet")
 {
 chk.Value = chk.TrueValue;

 }
 }




Aucun commentaire:

Enregistrer un commentaire