cxgrid 回车换行如何实现

cq_mark 2011-07-28 10:41:16
cxgrid 回车后就跳到下一个控件,想实现回车后移动到下一行记录,求助?
...全文
267 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dinoalex 2011-07-29
  • 打赏
  • 举报
回复
procedure TUBatchProcFrm.cxView1EditKeyDown(Sender: TcxCustomGridTableView;
AItem: TcxCustomGridTableItem; AEdit: TcxCustomEdit; var Key: Word;
Shift: TShiftState);
begin
if key = vk_return then
if not cds.Eof then cds.Next;
end;
cq_mark 2011-07-29
  • 打赏
  • 举报
回复
我用clientdataset来append数据,所以想通过回车来移动记录行和移动行记录里面的字段。已经在onEditKeyDown事件写focused,但无效。
代码如下:
if (key = VK_RETURN) then
begin
Key := 0;

if rDgd_DTDBTv.GetColumnByFieldName('Locator').Focused then
begin
rDgd_DTDBTv.GetColumnByFieldName('ProductSeries').Focused := True;
rDgd_DTDBTv.GetColumnByFieldName('ProductSeries').Editing := True;
end
else if rDgd_DTDBTv.GetColumnByFieldName('ProductSeries').Focused then
begin
cds_DT.Next;
rDgd_DTDBTv.GetColumnByFieldName('Locator').Focused := True;
rDgd_DTDBTv.GetColumnByFieldName('Locator').Editing := True;
end;
end;
dinoalex 2011-07-28
  • 打赏
  • 举报
回复
keydown里判断就行了, 然后执行 ado 的 next

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧