Ejemplo n.º 1
0
        private void DataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            DataGridViewCell currentCell    = MainGridView[e.ColumnIndex, e.RowIndex];
            bool             isInputCorrect = CheckCell(currentCell);

            SetCell(currentCell, isInputCorrect);

            ChangedCells.Add(currentCell);

            SetButtons(!BadCells.Any(), true, !BadCells.Any());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Remove cells inside the given row.
        /// </summary>
        /// <param name="row"></param>
        private void DeleteCellsFromRow(DataGridViewRow row)
        {
            foreach (DataGridViewCell cell in row.Cells)
            {
                if (ChangedCells.Contains(cell))
                {
                    ChangedCells.Remove(cell);
                }
                if (BadCells.Contains(cell))
                {
                    BadCells.Remove(cell);
                }
            }

            if (!BadCells.Any())
            {
                SetButtons(true, true, true);
            }
        }