Ejemplo n.º 1
0
        void HandleCellValidating(object sender, DataGridViewCellValidatingEventArgs e)
        {
            var gridViewCell = FDataGridView[e.ColumnIndex, e.RowIndex];
            var cell         = gridViewCell.Tag as ICell;
            var value        = Convert.ChangeType(gridViewCell.FormattedValue, cell.ValueType);

            if (!cell.ReadOnly)
            {
                if (!cell.AcceptsValue(value))
                {
                    FDataGridView.CancelEdit();
                }
            }
        }