1
Reply

Datagridview Checkbox remains unchecked in childform

pavan  prasad

pavan prasad

Jun 15 2017 5:10 AM
211
I have datagridview with checkbox in child form.It get checked on some conditin.When this child form called from parent form the checkbox in datagrid remains unchecked. How to solve the issue?
 
if (dt.Rows.Count > 0)
{
int i = 0;
foreach (DataRow row in dt.Rows)
{
if (row["IS_OUT"].ToString() == "1")
{
DataGridViewTextBoxCell txt = new DataGridViewTextBoxCell();
DataGridViewRow dgrow = gridholdarea.Rows[i];
txt.Value = "ALREADY IN";
dgrow.DefaultCellStyle.BackColor = Color.FromA#008272;
dgrow.Cells["CHECK"] = new DataGridViewTextBoxCell();
dgrow.Cells["CHECK"].Value = "ALREADY IN";
dgrow.Cells["CHECK"].ReadOnly = true;
}
else if (row["IS_CHANGE"].ToString() == "1")
{
gridholdarea.Rows[i].DefaultCellStyle.BackColor = Color.FromA#008272;
gridholdarea.Rows[i].Cells["CHECK"].Value = true;
}
i++;
}
}
 

Answers (1)