高分请教:如何捕捉DBGRID中记录移动的事件??
比如现在记录位置在第一条,如果我用鼠标单击第三条记录,则发生这个事件,如果仅单击第一条记录的不同列,则不发生这样的事件。
谢谢!
问题点数:100、回复次数:4Top
1 楼YJBOLD(YJB)回复于 2004-02-01 14:20:24 得分 0
我用的是ADODATASET 和DBGRID主件。
Top
2 楼chenylin(陈SIR)回复于 2004-02-01 14:23:01 得分 99
应该是ADODateSet的AfterScroll事件Top
3 楼IDWB()回复于 2004-02-01 14:28:44 得分 1
datasource 的 ondatechange事件
Delphi syntax:
property OnDataChange: TDataChangeEvent;
C++ syntax:
__property TDataChangeEvent OnDataChange = {read=FOnDataChange, write=FOnDataChange};
Description
Write an OnDataChange event handler to take specific actions when a field in the current record has been edited and the application moves to another field, or when the current record in the associated dataset changes. OnDataChange is especially useful in applications that must synchronize data display in controls that are not data-aware. This event is typically used to make sure the control reflects the current field values in the dataset, because it is triggered by all changes.
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:
Scrolling to a new record.
Modifications to a field's data.Top
4 楼YJBOLD(YJB)回复于 2004-02-01 14:29:58 得分 0
果然是高手!接分!Top




