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;
我用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;