private void updatesGrid_CellValueChanged(object sender, DataGridViewCellEventArgs e) { int saveType = 99; string fileName = updatesGrid.Rows[e.RowIndex].Cells[0].Value.ToString(); bool state = (bool)updatesGrid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; if (e.ColumnIndex == updatesGrid.Columns[2].Index && e.RowIndex != -1) // Legacy { OPT.AlterLegacyIndex(fileName, state); saveType = 0; } else if (e.ColumnIndex == updatesGrid.Columns[3].Index && e.RowIndex != -1) // Delete { OPT.AlterDeleteIndex(fileName, state); saveType = 1; } OPT.SaveIndex(saveType); }