首页 > 代码库 > 验证DataGridView单元格的值

验证DataGridView单元格的值

private void gridPurchaseOrderDetail_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)        {            if (gridPurchaseOrderDetail.Columns[e.ColumnIndex].CellType.ToString().Contains("TextBox"))             {                if (Common.GetDecimal(e.FormattedValue) < 0)                 {                    MessageBox.Show("请检查输入数据的格式", "消息", MessageBoxButtons.OK);                    e.Cancel = true;                }            }        }