cxgrid 回车后就跳到下一个控件,想实现回车后移动到下一行记录,求助?

解决方案 »

  1.   

    keydown里判断就行了, 然后执行 ado 的 next
      

  2.   

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

  3.   

    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;