int clmnIndex = e.ColumnIndex; int rowIndex = e.RowIndex; if (clmnIndex == 8) { DataGridViewCheckBoxCell chkBox = (DataGridViewCheckBoxCell)dgvAttendance.Rows[rowIndex].Cells[8]; if (chkBox.Value == chkBox.TrueValue) { if (dgvAttendance.Rows[rowIndex].Cells[7].Value == null) { dgvAttendance.Rows[rowIndex].Cells[3].Value = DateTime.Now.ToString("MMM dd, yyyy"); dgvAttendance.Rows[rowIndex].Cells[4].Value = DateTime.Now.ToString("HH:mm:ss"); dgvAttendance.Rows[rowIndex].Cells[7].Value = "CheckIn"; } else { dgvAttendance.Rows[rowIndex].Cells[5].Value = DateTime.Now.ToString("HH:mm:ss"); } } else if (chkBox.Value == chkBox.FalseValue) { if (dgvAttendance.Rows[rowIndex].Cells[7].Value == null) { dgvAttendance.Rows[rowIndex].Cells[3].Value = string.Empty; dgvAttendance.Rows[rowIndex].Cells[4].Value = string.Empty; dgvAttendance.Rows[rowIndex].Cells[7].Value = string.Empty; } else { dgvAttendance.Rows[rowIndex].Cells[5].Value = string.Empty; } }
string.IsNullOrEmpty(mystring)
mystring == null
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)