try this,
private void DGVCalendar_CurrentCellDirtyStateChanged(object sender, EventArgs e)
{
try
{
DataGridView dgv = (DataGridView)sender;
DataGridViewCell cell = dgv.CurrentCell;
if (cell.RowIndex > -1 && (cell.ColumnIndex == 1 || cell.ColumnIndex == 2))
{
if (cell.ColumnIndex == 1)
{
DGVCalendar.Rows[cell.RowIndex].Cells[1].Value = true;
DGVCalendar.Rows[cell.RowIndex].Cells[2].Value = false;
}
else
{
DGVCalendar.Rows[cell.RowIndex].Cells[2].Value = true;
DGVCalendar.Rows[cell.RowIndex].Cells[1].Value = false;
}
}
}
catch (Exception exc)
{
exc.ToString();
}
}