procedure TForm1.filterEditChange(Sender: TObject);
var
fltText: string;
procedure ProcessEmpty;
var
Row: integer;
begin
BeginFormUpdate;
for Row := 0 to stringGrid.RowCount - 1 do
begin
stringGrid.RowHeights[Row] := stringGrid.DefaultRowHeight;
end;
EndFormUpdate;
end;
procedure ProcessAll;
var
Row: integer;
begin
BeginFormUpdate;
for Row := 1 to stringGrid.RowCount - 1 do
if (not (ContainsText(stringGrid.Cells[1,Row], fltText))) then
stringGrid.RowHeights[Row] := 0
else
stringGrid.RowHeights[Row] := stringGrid.DefaultRowHeight;
EndFormUpdate;
end;
begin
fltText := TEdit(Sender).Text;
if fltText = '' then
ProcessEmpty
else
ProcessAll;
end;