Busca incremental na StringGrid
Galera , tem como fazer um busca incremental na STRINGGRId por um edit ?
valeu
valeu
Michel
Curtidas 0
Respostas
Spider
06/12/2003
tem sim... passe com detalhes que eu posso achar a melhor saída!
GOSTEI 0
Michel
06/12/2003
Erique é o Seguinte , tenho um formulario de clientes onde tenho a TabSheet1 que vai ficar as relacoes de clientes e a Tabcheet2 que vai ficar a manutencao de clientes...Pra eu nao utilizar o dbgrid e ficar com a tabela aberta estava pensando em jogar os clientes na grid e colocando um editi para buca onde ele ia digitar ( Joao ) e buscaria a StringGrid onde Estivesse o Joao..A Ideia Seria essa...
Outra coisa se vc puder me ajudar, nao estou conseguindo alinhar uma coluna da StringGrid a Direita..
Muito Obrigado
Outra coisa se vc puder me ajudar, nao estou conseguindo alinhar uma coluna da StringGrid a Direita..
Muito Obrigado
GOSTEI 0
Spider
06/12/2003
na busca...nesse caso é bem simples... só acha se digitar um pedaço do nome certo joao<>joão para aceitar isso deve ser implementado
procedure...
var i: integer;
begin
for i:=1 to StringGrid1.RowCount-1 do
begin
if Pos(StringGrid1.Cells[1,i])<>0 then
begin
StringGrid1.row:=i;
break;
end;
end;
end;
para alinhar a Direita:
no Evento OnDrawCell:
var
strTemp: string;
Format: integer; {pode ser DT_CENTER, DT_LEFT OU DT_RIGHT}
begin
strTemp := StringGrid1.Cells[ACol,ARow];
StringGrid1.Canvas.FillRect(Rect);
if (ARow = 0) then
Format := DT_CENTER
else
Format := DT_LEFT;
// para alinhar apenas uma determinada coluna à direita
if (ACol=2) and (Arow<>0) then
Format := DT_RIGHT;
DrawText(StringGrid1.Canvas.Handle,PChar(strTemp),-1,Rect,Format);
end;
procedure...
var i: integer;
begin
for i:=1 to StringGrid1.RowCount-1 do
begin
if Pos(StringGrid1.Cells[1,i])<>0 then
begin
StringGrid1.row:=i;
break;
end;
end;
end;
para alinhar a Direita:
no Evento OnDrawCell:
var
strTemp: string;
Format: integer; {pode ser DT_CENTER, DT_LEFT OU DT_RIGHT}
begin
strTemp := StringGrid1.Cells[ACol,ARow];
StringGrid1.Canvas.FillRect(Rect);
if (ARow = 0) then
Format := DT_CENTER
else
Format := DT_LEFT;
// para alinhar apenas uma determinada coluna à direita
if (ACol=2) and (Arow<>0) then
Format := DT_RIGHT;
DrawText(StringGrid1.Canvas.Handle,PChar(strTemp),-1,Rect,Format);
end;
GOSTEI 0
Michel
06/12/2003
Valeu Cara , Muito Obrigado
GOSTEI 0