我用了tableview.DataController.FocusControl() 方法可以移动焦点了,可是遇到更改了列的属性比例,第二列设为 dateEdit, 焦点跳上去就要报"control '' has no parent window" 错误. 怎么解决呢?
procedure TForm1.vWEditKeyDown(Sender: TcxCustomGridTableView;
AItem: TcxCustomGridTableItem;
AEdit: TcxCustomEdit;
var Key: Word;
Shift: TShiftState);
var
a: boolean;
begin
if key = vk_left then
begin
AEdit.PostEditValue;
vW.DataController.FocusControl(vW.Controller.FocusedColumn.Index-1,a);
end;
if key = vk_right then
begin
AEdit.PostEditValue;
vW.DataController.FocusControl(vW.Controller.FocusedColumn.Index+1,a);
end;
end;