贫民窟里的程序高手

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
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;
                }
            }
        }

 

posted on 2014-08-11 16:32  贫民窟里的程序高手  阅读(270)  评论(0)    收藏  举报