TcxGrid NewItemRecord Validate(TcxGrid NewItemRecord验证)
来源:互联网 发布:杭州创业软件实施 编辑:程序博客网 时间:2024/06/14 14:53
原文地址:https://www.devexpress.com/Support/Center/Question/Details/Q273430
1、对于绑定的TcxGrid的验证:
You can solve this problem on the DataSet level. Just handle the DataSet's OnBeforePost event, and check necessary values there if the DataSet's state is dsInsert. If certain fields contains incorrect values, you can call the DataSet.Cancel method to cancel changes, or call the Abort method if values are not valid, to prevent the NewItemRow data from disappearing:
[Delphi]Open in popup windowprocedure <aForm>.<aDataSet>BeforePost(DataSet: TDataSet);begin if (DataSet.State = dsInsert) and <IsRowDataInvalid> then begin //Perform your actions Abort; end;end;
2、对于非绑定的TcxGrid的验证
You can perform this task at an unbound View's DataController level. Just handle the DataController's OnBeforePost event and check the record's data there. If data is invalid, call the Abort method:
[Delphi]Open in popup windowprocedure <aForm>.<aView>DataControllerBeforePost( ADataController: TcxCustomDataController);var AController: TcxCustomGridTableController;begin AController := TcxGridDataController(ADataController).GridView.Controller; if AController.NewItemRecordFocused then if not <IsRecordDataValid(AController.FocusedRecord)> then begin //Perform your actions Abort; end;end;
0 0
- TcxGrid NewItemRecord Validate(TcxGrid NewItemRecord验证)
- TcxGrid使用
- TCXGRID控件常用属性介绍
- TCXGRID控件常用属性介绍
- TcxGrid set column properties programmatically
- tcxGrid状态字段显示成汉字
- delphi 如何让tcxGrid左边显示序号
- TcxGrid的TcxGridDBTableView.ViewData.Rows跟Records有什么区别
- C++Builder中关于TcxGrid的使用总结
- tcxgrid控件中drag a column header here to group by that column移除方法
- dephi tcxgrid How to Retrieve the Record Values for the Selected Grid Rows
- 对于C++ Builder 使用DevPress 控件中的TCXGrid 添加复选框 在勾选时会闪退
- validate验证
- validate验证
- validate验证框架
- validate方法验证数据
- validate个性化验证
- jQuery validate 分组验证
- mysql数据库复合索引
- combotree 默认选中值
- 用axis2解析xml失败的原因分析和解决方法
- 使用JDBC连接mysql数据库异常:ClassNotFound
- PAT 1023. Have Fun with Numbers (20)(字符串转换,20位数的加法)
- TcxGrid NewItemRecord Validate(TcxGrid NewItemRecord验证)
- 鱼与熊掌不可兼得!VS调试时拒绝访问的原因探究
- 单击按钮进行页面跳转
- Oracle常用sql语句整理
- LeetCode笔记:136. Single Number
- 《组合变身小宠物游戏》MonsterPetItem(修改更新中)【初学者】
- 11章 上机练习5
- Shell脚本浮点运算
- 架构之路