在DBGrid的DrawColumnCell事件中加入
if (gdFocused in State) then
begin
if datacol=0 then //此处0指dbgrid的第一列数据
begin
ComboBox1.Left := Rect.Left+dbGrid1.Left+1;
ComboBox1.Top := Rect.Top+dbGrid1.top+1;
ComboBox1.Width :=Rect.Right-Rect.Left;
ComboBox1.Height :=Rect.Bottom-Rect.Top;
ComboBox1.Visible := True;
ComboBox1.SetFocus;
end
else
begin
ComboBox1.Visible := false;
end;
end;