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