DataGridViewCheckBoxCell后台获取勾选
回头是岸 2010-08-16 12:57:08 statusViewText.Text = "数据正在处理中.....";
int count = Convert.ToInt32(dgvLeaveInfo.Rows.Count.ToString());
for (int i = 0; i < count; i++)
{
DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)dgvLeaveInfo.Rows[i].Cells["gvChecked"];
if (dgvLeaveInfo.Rows[i].Cells["gvChecked"].Value !="" )
{
if ((Boolean)checkCell.Value) //删除被选择的数据行
{
MAttendance attendance = (MAttendance)_CurrentMAttendance[i];
int typeId = attendance.TypeId;
DateTime beginTime = Convert.ToDateTime(attendance.BegTime);
message = client.DeletAbsenteeismInfo(typeId, beginTime, AttendanceMonth);
if (message.IsSuccess)
{
_CurrentMAttendance.Remove(attendance);
}
statusViewText.Text = "数据处理完毕";
}
}
}
这里dgvLeaveInfo.Rows[i].Cells["gvChecked"].Value !=""或dgvLeaveInfo.Rows[i].Cells["gvChecked"].Value !=null都报错
这是怎么回事?