Пример #1
0
        private void DataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
        {
            FormValidation validation = new FormValidation(dataGridView, this);

            validation.ValidateCelling(sender, e);
            validation.CheckDuplicate();
        }
Пример #2
0
        private void DataGridView_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            FormValidation validation = new FormValidation(dataGridView, this);

            if (e.RowCount > 0)
            {
                dataGridView.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Gray;
                validation.CheckDuplicate();
                label1.Text = "Liczba rekordów: " + dataGridView.Rows.Count;
            }
        }