各位高手:
       请问我怎样在 DBGrid 的网格中嵌套 别的控件.譬如:Checkbox,RadioBox...

解决方案 »

  1.   

    这里有个可以http://www.nicesoft.net
      

  2.   


    先放一个DateTimePicker1,然后设置为隐藏,在dbgrid的onDrawColumnCell事件中写入://表示的是要在dbgrid的那个字段下显示该组件。
      if (gdfocused in state) and (column.FieldName='表的字段') then
        begin
          DateTimePicker1.SetBounds(rect.Left + dbgrid1.Left + 1,rect.Top + dbgrid1.Top +1,
                                    rect.Right - rect.Left ,rect.Bottom -rect.Top);然后在onColEnter中写入:编辑状态显示DateTimePicker1控件。
    if dbgrid1.Columns [dbgrid1.SelectedIndex ].FieldName ='Der' then
          DateTimePicker1.Visible :=true
      else
         DateTimePicker1.Visible :=false;
      

  3.   

    上面这样子不行,可能会不停的闪烁。可以改为:
    1.在OnDrawColumnCell事件里加上DateTimePicker1.Visible := True;
    2.在OnColExit事件里判断字段相应时加上DateTimePicker1.Visible := False;
      

  4.   

    有一本书上就有呀!
    delphi编程疑难详解
    人民邮电出版社
    第347页