0
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;
}
}
選中狀態不改變爲選中,我怎樣才能改變如何更改DataGridViewCheckBoxCell運行的代碼<code>DataGridViewCheckBoxCell</code>後代碼
我試圖
DataGridViewCheckBoxCell cell = (DataGridViewCheckBoxCell)dataGridViewProductList.Rows[dgvr.Index].Cells["chk"];
cell.ReadOnly = false;
cell.TrueValue = true;
cell.Value = cell.TrueValue;
但不工作的選中狀態。
'cell.Value = CheckState.Checked;'' – bansi
= cell.Value CheckState.Checked;'它不工作對我來說@bansi –
價值爲布爾類型:'.value的= TRUE' – Slai