在写一个数据库应用的时候发现:
如果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方法等。
1549

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



