Occurs just before the data is written to the record buffer.

Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer. The EditMask property allows validation of the data on a character by character basis while it is being entered by the user. OnValidate allows an application to validate the data as a whole.

When the value of a field component is assigned programmatically, validation by the EditMask is bypassed, since there is no data-aware control to enforce adherence to the mask. OnValidate allows an application to validate such data before it is posted to the database table.

To reject the current value of the field from the OnValidate event handler, raise an exception.

When writing the value of a field to the current record buffer, the following steps occur:

1 The OnValidate event handler is called to validate the data. 
2 If the OnValidate event handler does not raise an exception, the data is written to the current record buffer. 
3 If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.

TField OnValidate 事件的更多相关文章

  1. delphi中adoquery控件中某个字段Onvalidate事件的用法?

    procedure TForm2.ADOQuery1TestFieldValidate(Sender: TField);begin// Sender就是当前字段,可以在这里对Sender字段进行各种操 ...

  2. TkbmMWClientQuery的计算字段在CalcFields事件触发次数太多

    kbmmw有两处BUG和作者提下,一个是TkbmMWClientQuery的计算字段在CalcFields事件触发次数太多,另一个是在TkbmMemTable的加载数据时字段会执行OnValidate ...

  3. Delphi 在dbgrideh中表格输入数据时有效性的检查(转)

    在数据库系统设计中经常要用到在表格中进行数据录入,如何判断在数据导入时的数据有效性呢?下面介绍几种常用的方法与大家交流. 方法一:Dbgrid是与Table,在Table的Column的OnSetTe ...

  4. DXDBGrid使用方法

    http://www.cnblogs.com/gtsup/archive/2012/08/28/2660197.html dxDBGrid使用集锦   转载自:http://hi.baidu.com/ ...

  5. jQuery EasyUI 1.4更新记录

    问题: menu:修复当删除一个menu项时.menu高度不准确. datagrid:修复当datagrid宽度太小时,fitColumns方法不能使用. 改进: 1.为easyui全部组件新增了自适 ...

  6. JNI详解---从不懂到理解

    转载:https://blog.csdn.net/hui12581/article/details/44832651 Chap1:JNI完全手册... 3 Chap2:JNI-百度百科... 11 C ...

  7. query中对应的OnSetText和onGetText事件

    今天在看代码的时候遇到一个问题,query中的某个字段和在表中显示的不是一个值,我觉得很奇怪,于是找了很久,才知道为什么,原来是query中的OnSetText和onGetText事件在作怪,经过一番 ...

  8. delphi7中 OnDrawColumnCell 事件怎么用

    你问的这个事件应该是dbgrid控件中的吧?这个事件是在grid控件载入数据的时候触发的,至于你这个“怎么用”波及的范围太大了,呵呵!不知道如何说起!另外还是发一段相关的代码吧,这也是我之前提过问题, ...

  9. TField中的GetText和SetText

    在数据表中的某些字段出于性能或数据规范化的考虑,会用组编号代替,就像学生有学号,员工有员工ID一样,但我们看的时候如果直接输入这样的编号看的人可能就会头痛了,这时就可用TField中的GetText转 ...

随机推荐

  1. How to get Docker

    Docker 通俗的理解就是像VM一样的虚拟技术,但是不完全相同. Docker可以打包为镜像文件,在镜像中运行容器. 镜像和容器可以理解成类和对象的关系. 拿VM虚拟机和docker来举例,一个容器 ...

  2. Spring Security(九):2.4.4 Checking out the Source(检查来源)

    Since Spring Security is an Open Source project, we’d strongly encourage you to check out the source ...

  3. JS中navigator对象详解

    <code class="language-html"><!doctype html> <html> <head> <meta ...

  4. __attribute__ 机制详解(一)

    GNU C 的一大特色就是__attribute__ 机制.__attribute__ 可以设置函数属性(Function Attribute).变量属性(Variable Attribute)和类型 ...

  5. C++模板参数类型(转载)

    实际上有三种类型模板参数:类型模板参数.无类型模板参数和模板模板参数(以模板作为模板的参数). .类型模板参数 类型模板参数是我们使用模板的主要目的.我们可以定义多个类型模板参数: template& ...

  6. LDAP1-安装部署LDAP服务

    基于Linux部署openldap服务 参考文档: https://blog.csdn.net/computer1024/article/details/78172785 参考文档:  https:/ ...

  7. LOJ6036 编码 2-SAT、Trie

    传送门 每个串只有一个?,?还只能填0或者1,不难想到2-SAT求解. 一个很暴力的想法是枚举?填0或者1,然后对所有可能的前缀连边.这样边数是\(O(n^2)\)的,需要优化. 看到前缀不难想到Tr ...

  8. kafka+storm结合存在的一些问题与解决方法

    在配置kafka和storm的时候, 经常的会出现一些问题, 主要在以下几个: 1.  打jar包上去storm集群的时候会出现jar包冲突,类似于log4j或者sf4j的报错信息. 2. kafka ...

  9. Apache Spark 2.2.0新特性介绍(转载)

    这个版本是 Structured Streaming 的一个重要里程碑,因为其终于可以正式在生产环境中使用,实验标签(experimental tag)已经被移除.在流系统中支持对任意状态进行操作:A ...

  10. 面试 9:Java 玩转冒泡排序

    面试 9:用 Java 实现冒泡排序 南尘的朋友们,新的一周好,原本打算继续讲链表考点算法的,这里姑且是卡一段.虽然在我们 Android 开发中,很少涉及到排序算法,因为基本官方都帮我们封装好了,但 ...