It has been awhile since I have done any programming in Delphi and I was looking around for some examples on how to incrementally search a dbgrid by typing a search term into a edit box and I found the following code which seems to do the trick for the most part, but it checks for the filter condition on every column in the grid and I would like to limit the filter condition so it only checks one column in the grid (Column 1 for instance), how would I do that using the code provided ?
procedure TForm1.Edit1Change(Sender: TObject);
begin
FDTable1.Filtered := false;
FDTable1.Filtered := Edit1.Text <> '';
end;
procedure TForm1.FDTable1FilterRecord(DataSet: TDataSet;
var Accept: Boolean);
var
i: integer;
begin
for i := 0 to DataSet.FieldCount - 1 do begin
Accept := Pos(UpperCase(Edit1.Text),
UpperCase(DataSet.Fields[i].AsString)) = 1;
if Accept then exit;
end;
end;