foreach (DataGridViewRow dgvr in dataGridViewProductList.Rows)
{
string dgvrID = dgvr.Cells["ID"].Value.ToString();
DataRow[] s = DT.Select("BillID = " + dgvrID);
if (s.Length > 0)
{
dataGridViewProductList.Columns["chk"].ReadOnly = false;
dataGridViewProductList.Rows[dgvr.Index].Cells["chk"].ReadOnly = false;
dataGridViewProductList.Rows[dgvr.Index].Cells["chk"].Value = 1;
}
}
after running code DataGridViewCheckBoxCell
doesn't changed to checked, how can i change its checked state
i tried
DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)dataGridViewProductList.Rows[dgvr.Index].Cells["chk"];
cell.ReadOnly = false;
cell.TrueValue = true;
cell.Value = cell.TrueValue;
but doesn't work.