起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 663|回复: 0

在DataGrid中用回车来进行记录滚动

[复制链接]
发表于 2008-7-8 09:56:49 | 显示全部楼层 |阅读模式
1、取消 OptionsEx  的 edgoEnterThrough 和 edgoEnterShowEditor 属性
2、在DataGrid 的 onKeyPress事件上实现,代码参考如下:
procedure TMainForm.DataGrid1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
  begin
    TDataGrid(Sender).DataSource.DataSet.Next;
    TDataGrid(Sender).ShowEditor;
  end;
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2024-4-27 11:53 , Processed in 0.042887 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表