评论会员:游客 时间:2012/02/04
点击控制CheckedChanged事件,你还可以得到当前行的点击控制,也可以找到同一行的剩余控制
Nathansathya:我终于解决方案为这个......
下面的代码,写上CellValidating事件
int column = e.ColumnIndex;
int row = e.RowIndex;
if (column == 2)
{
DataGridViewCheckBoxCell c = dgv1[e.ColumnIndex, e.RowIndex] as DataGridViewCheckBoxCell;
if (c != null)
{
string a = e.FormattedValue.ToString();
if (a == "True")
{
dgv1.Rows[row].Cells["column2"].Value = false;
dgv1.Rows[row].Cells["column3"].Value = false;
}
else
{
dgv1.Rows[row].Cells["column1"].Value = false;
dgv1.Rows[row].Cells["column2"].Value = false;
dgv1.Rows[row].Cells["column3"].Value = false;
}
}
}
重复代码的其余列........
评论会员:萨拉SS 时间:2012/02/04
的DataTable DT =新的DataTable()的foreach(DataRow中排在dt.Rows)
{
(行["gridviewcheckboxcolumnname"] =="真"的ToString())
{
NBSP / /您的代码
}
}