DataGird 已经绑定了datasource
一些checked
和unchecked
值。我必须禁用检查其值的按钮。
private void disableManualBuyButtons()
{
foreach (DataGridViewRow row in gvViewTickets.Rows)
{
DataGridViewCheckBoxCell cbc = (DataGridViewCheckBoxCell)row.Cells[0];
cbc.TrueValue = true;
if (cbc.Value.Equals(cbc.TrueValue))
{
DataGridViewButtonCell btn = (DataGridViewButtonCell)row.Cells[8];
btn.ReadOnly = true;
}
}
}