Grid / DBGrid com Check?? Ond Posso Conseguir????

Delphi

29/09/2003

Eu gostaria d saber ond posso concguir uma Grid / DBGrid q tenha Check.
Grato!!!!!


Cangurud

Cangurud

Curtidas 0

Respostas

Marcelo.c

Marcelo.c

29/09/2003

http://delphiforum.icft.com.br/forum/viewtopic.php?t=19587&highlight=dbgrid+checkbox


GOSTEI 0
Rodrigo Bergmann

Rodrigo Bergmann

29/09/2003

Ou faça assim:

Para colunas boolean:
DbGrid1.Columns[1].Alignment:=taCenter;
DbGrid1.Columns[1].Font.Name:=´Wingdings;

No OnGetText dos campos boolean:

procedure TDataModule1.Table1GetText(Sender: TField; var Text: String; DisplayText: Boolean);
begin
  if Sender.AsBoolean then Text:=#254
  else Text:=168;
end;


Nos Eventos OnDblClik e OnKeyPress do DBGrid:

if DBGrid1.SelectedField.Name=´Table1Campo´ then 
begin
  with DBGrid1.SelectedField do
  begin
    if DataSet.State=dsBrowse then
       DataSet.Edit;
    AsBoolean:=not AsBoolean;
  end;
  Key:=0; //só no  OnKeyPress
end; 



GOSTEI 0
POSTAR