[ chips @ 19.08.2006. 17:53 ] @
Zeleo bi da dok ukucavam neke vrednosti u odredjenu celiju DBGrida da se za svako novu promenu u toj celiji ,vrednost trenutno iscrtanog tekst akoristi kao filter za neku drugu tabelu. Ovako nesto je sasvim lako uraditi sa recimo DBEdit poljem jer ono ima OoChange dogadjaj. Da li moze da se napravi da i celija DBGrid aima svoj OnChange dogadaj.
[ delalt @ 19.08.2006. 21:23 ] @
Može ti ovo pomoći, možda uz malu doradu:
Code:
procedure TForm1.DBGrid1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState) ;
var
   i: Integer;
begin
  for i := 0 to DBGrid1.ControlCount - 1 do
    if DBGrid1.Controls[i] is TInPlaceEdit then 
     begin
      with DBGrid1.Controls[i] as TInPlaceEdit do 
       begin
        Label1.Caption := Label1.Caption + Text;
       end;
     end;
end;
[ chips @ 19.08.2006. 22:30 ] @
To je to. Samo ja sam uradio ovako, jer sam zeleo da mi filtrira odredjenu bazu i to samo iz te celije:



procedure TForm1.DBGrid1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState) ;
var
i: Integer;
begin

if DBGrid1.SelectedIndex = 14 then begin

for i := 0 to DBGrid1.ControlCount - 1 do
if DBGrid1.Controls is TInPlaceEdit then
begin
with DBGrid1.Controls as TInPlaceEdit do
begin
Table9.Filter:='nazivpolja=' + QuotedStr(Text + '*');
end;
end;
end;
end;

Svaka ČAST.