DBGrid - colocando combo

Top  Previous  Next

Do meu Baú, nunca testei, dica postada aqui no news

 nColoque um DbCheckBox no formulário, atrás da DbGrib e configure-o para

ser utilizado.

   No DbGrid, deixe a propriedade DefaultDrawing como true, vamos utilizar o

evento OnDrawColumnCell :

 

procedure TForm1.DbGrib1DrawColumnCell(sender:TObject; const Rect:TRect;

DataCol:Integer; Column:TColumn; State:TGridDrawState);

begin

  if (gdFocused in State) and (Column.Field=Table1NOMEDOCAMPO) then 

    {o nome do campo é o mesmo do DbCheckbox}

  begin

    DbCheckBox1.SetBounds(Rect.Left+DbGrid.Left+1,Rect.Top+DbBrid.Top+1,Rect.Rig

                          ht-Rect.Left,Rect.Bottom-Rect.Top);

   end;

end;