DBEdit em DBGrid
10/11/2009
0
Coloquei um DBEdit em uma coluna do DBGrid. Funcionou perfeitamente até o momento de usar a barra de rolagem de baixo, no momento que rolo a barra de rolagem de baixo o DBEdit que esta na coluna deveria sumir junto com a coluna só que isto não acontece. O que devo fazer?
Abaixo segue os códigos
procedure TFormOrcamento.DBGProdutosColExit(Sender: TObject);
begin
If DBGProdutos.SelectedField.FieldName = 'PRODUTO_OIT' then
DBEdit1.Visible := False;
end;
procedure TFormOrcamento.DBGProdutosDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
If (gdFocused in State) then
begin
If Column.Field = ADOQOrcamentoItensFPRODUTO_OIT then
begin
With DBEdit1 do
begin
Left := Rect.Left + DBGProdutos.Left + 1;
Top := Rect.Top + DBGProdutos.Top + 1;
Width := Rect.Right - Rect.Left + 2;
Width := Rect.Right - Rect.Left + 2;
Height := Rect.Bottom - Rect.Top + 2;
Visible := True;
end;
end;
end;
end;
Abaixo segue os códigos
procedure TFormOrcamento.DBGProdutosColExit(Sender: TObject);
begin
If DBGProdutos.SelectedField.FieldName = 'PRODUTO_OIT' then
DBEdit1.Visible := False;
end;
procedure TFormOrcamento.DBGProdutosDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
If (gdFocused in State) then
begin
If Column.Field = ADOQOrcamentoItensFPRODUTO_OIT then
begin
With DBEdit1 do
begin
Left := Rect.Left + DBGProdutos.Left + 1;
Top := Rect.Top + DBGProdutos.Top + 1;
Width := Rect.Right - Rect.Left + 2;
Width := Rect.Right - Rect.Left + 2;
Height := Rect.Bottom - Rect.Top + 2;
Visible := True;
end;
end;
end;
end;
Leandro Carvalho
Curtir tópico
+ 0
Responder
Posts
10/11/2009
Marcos Iwazaki
de uma olhada nesses codigos
http://delphi.about.com/od/usedbvcl/l/aa082003a.htm
http://delphi.about.com/od/usedbvcl/l/aa121503a.htm
espero que ajude
http://delphi.about.com/od/usedbvcl/l/aa082003a.htm
http://delphi.about.com/od/usedbvcl/l/aa121503a.htm
espero que ajude
Responder
13/11/2009
Leandro Carvalho
Este links foi de onde tirei os códigos.
Lá não tem a solução.
Lá não tem a solução.
Responder
Clique aqui para fazer login e interagir na Comunidade :)