Ejemplo n.º 1
0
        /// <summary>
        /// Changes given cell based on it's formatting
        /// </summary>
        /// <param name="cell"></param>
        /// <param name="isFormattingCorrect"></param>
        private void SetCell(DataGridViewCell cell, bool isFormattingCorrect)
        {
            if (isFormattingCorrect)
            {
                if (BadCells.Contains(cell))
                {
                    BadCells.Remove(cell);
                }
                cell.Style.BackColor = Color.PaleGreen;
            }
            else
            {
                if (!BadCells.Contains(cell))
                {
                    BadCells.Add(cell);
                }
                cell.Style.BackColor = Color.IndianRed;
            }

            if (MainGridView.Columns[cell.ColumnIndex].Name == "Apartment")
            {
                if (!ChangedCells.Contains(cell))
                {
                    cell.Style.BackColor = Color.Empty;
                }
            }
        }
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);
            }
        }