GridControl 校验输入单元格格式

来源:互联网 发布:snare for windows 编辑:程序博客网 时间:2024/05/21 22:37

      

// 对应的校验行事件,ValidateRow

private void gv_FeeItem_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e)
        {
            object name = this.gv_FeeItem.GetFocusedRowCellValue(gc_SubjectName);
            if (name is DBNull)
            {
                e.ErrorText = "提示错误信息";
                this.gv_FeeItem.SetColumnError(gc_SubjectName, e.ErrorText, ErrorType.Critical);
                e.Valid = false;
                return;
            }
}