// 对应的校验行事件,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;
}
}
本文介绍如何使用DevExpress Grid控件中的ValidateRow事件进行单元格数据校验,确保gc_SubjectName字段不为空,否则显示错误提示。
1296

被折叠的 条评论
为什么被折叠?



