关于定义dategridview中的checkboxcolumn事件
小弟根据现有的能力,在设计dategridview的checkboxcolumn中,设定单击便能打钩,代码如下
private void empInfo_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (this.empInfo.CurrentRow.Cells["E_delete"].Selected == true)
{
if (this.empInfo.CurrentRow.Cells["E_delete"].FormattedValue.ToString() == "False")
{
this.empInfo.CurrentRow.Cells["E_delete"].Value = true;
}
else
{
this.empInfo.CurrentRow.Cells["E_delete"].Value = false;
}
}
}