private void gdv_reguline_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e)
        {
            int col = ((DevExpress.XtraGrid.Views.Grid.GridView)sender).FocusedColumn.AbsoluteIndex;
            if (col == 4 || col == 5)
            {
                object v = e.Value;
                int tm;
                if (v != null && (!Int32.TryParse(v.ToString(),out tm) || tm<0 )) //自定义验证逻辑
                {
                    e.Valid = false; //控制是否通过验证的开关


                    e.ErrorText = "必须输入正整数!"; //提示的验证失败的原因
                }
            }
        }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案