验证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;
                }
            }
        }

 

验证DataGridView单元格的值,布布扣,bubuko.com

验证DataGridView单元格的值

上一篇:006-UIWindow


下一篇:windows下egret环境搭建