DBGrid的TColumn对象有个PickList属性,它是TStrings类型的,就可以实现类似于下拉列表的功能。
捕捉你鼠标选择的那一列可以在OnEditButtonClick的事件里写下如下代码:
  if DbGrid.selectedField.FieldName='aa' then
  begin
  //
  end;

解决方案 »

  1.   

    在Column属性页中设置PickList参数即可加入下拉列表框,加入其它控件比较难。
    在DBGRID的onCellClick事件中就能读取当前鼠标所点击的列。
      

  2.   

    下面是显示一个button的代码,combobox也是一样
    procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
      Field: TField; State: TGridDrawState);
    begin
       if (gdFocused in State) then
        begin
         if (Field.FieldName = Button1.hint  ) then
           begin
            Button1.Left :=  DBGrid1.Left + Rect.left + 108;
            Button1.Top := Rect.Top + DBGrid1.top + 2;
            Button1.Width := 18;
            Button1.Height := 18;
            Button1.Visible := True;
         end;
        end;
    end;