在写一个数据库应用的时候发现:
如果DBgrid1.datasource为Datasource1,
则执行
DBgrid1.columns[0].width:=40
将会触发datasource1的onDataChange事件.
迷惑中查找delphi help,说明如下:
Occurs when the data in a record has changed, either due to field edits or moving the cursor to a new record.
Methods that can trigger this event include the Next or Prior methods for the dataset. Data-aware controls notify a data source of a data change when:
1.Scrolling to a new record.
2. Modifications to a field's data.
在编写数据库应用时,当DBgrid1.datasource为Datasource1,执行DBgrid1.columns[0].width:=40会触发datasource1的onDataChange事件。查阅Delphi帮助文档可知,记录数据改变、数据集的Next或Prior方法等会触发该事件,数据感知控件在滚动到新记录或修改字段数据时也会通知数据源。
1544

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



