有很多在dbgrid上画控件的例子,搜一吧就有了。

解决方案 »

  1.   

    直接在DbGrid中设置一列(类型为字符型)即可,直接输入“√”为选中状态,输入“ ”为非选中状态即可。
      

  2.   

    //不知道从那位的道的了。解决问题就行了。
    procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
      DataCol: Integer; Column: TColumn; State: TGridDrawState);
    begin
    checkbox1.SetBounds(rect.Left+dbgrid1.Left+1,rect.Top+dbgrid1.Top+1,rect.Right-rect.Left,rect.Bottom-rect.Top);
    end; 
    =====================
    您可以根据需要改变一下checkbox的位置.比如判断一下是否是第一列:
    if if (gdFocused in state) and (column.FieldName='LAST_NAME') THEN
    begin
    checkbox1.setbounds...
    end