Delphi中
当一个数据表格控件(DBGrid)与一个 空的 数据集关联
一般在这个数据表格控件获得焦点的时候,
系统会自动插入一条新的记录以供编辑
似乎是DataSource.AutoEdit控制的,现在的问题是:自动插入的这个记录没有意义,我也不需要有什么办法:
既可以让数据集在获得焦点时自动进入编辑状态
又可以在数据集为空时不插入新的记录?
(只需要编辑现有的记录,不允许手工插入新的记录)
当一个数据表格控件(DBGrid)与一个 空的 数据集关联
一般在这个数据表格控件获得焦点的时候,
系统会自动插入一条新的记录以供编辑
似乎是DataSource.AutoEdit控制的,现在的问题是:自动插入的这个记录没有意义,我也不需要有什么办法:
既可以让数据集在获得焦点时自动进入编辑状态
又可以在数据集为空时不插入新的记录?
(只需要编辑现有的记录,不允许手工插入新的记录)
解决方案 »
- 祝朋友国庆快乐!顺便请教个问题:读取固定标题的CSV,有什么好办法吗?
- delphi我想实现这个功能
- 帮忙把以下三句C语言转成DELHPI 就送100分(简单呀)
- AdvStringGrid格式化问题
- 如何将字符流转换为原来的字符串
- 关于bt下载的一些问题
- 求助,如何把WAV文件转化为MP3文件?
- 问两个可能大家在做软件时经常碰到的问题,特别是了应用软件的哦@@@@@@@
- 就急:在delphi里面把月份减一,不用什么formatdatetime。
- Delphi中怎样调用C语言的lib文件
- 请问Delphi上有没有类似Visual Assist X那样的语法高亮工具?
- 我几道Delphi的题,你能帮帮我吗? 很急,谢谢了!
Determines if a data source component automatically calls a dataset抯 Edit method when a data-aware control associated with the data source receives focus.Delphi syntax:property AutoEdit: Boolean;C++ syntax:__property bool AutoEdit = {read=FAutoEdit, write=FAutoEdit, default=1};DescriptionAutoEdit is true by default. If AutoEdit is true, then when a user attempts to modify the data displayed by the control the data source calls the underlying dataset抯 Edit method.Set AutoEdit to false to protect data from unintentional modification. Even if AutoEdit is false, an application can explicitly call a dataset抯 Edit method to permit data modification.
if (DataSet.FieldByName('NIAN').AsInteger<1900) then
begin
DataSet.Cancel;
end;