Hello,
I have a DBAdvGrid that has its PageMode := False.
There is a TEdit that I am using to Filter rows in the DBAdvGrid.
Here is the Code:
*******************************************
procedure TFormOrders.Edit1Change(Sender: TObject);
var
MyString: String;
Splitted: TArray<String>;
I : Integer;
begin
DBAdvGrid1.FilterActive := False;
DBAdvGrid1.Filter.Clear;
MyString := Trim(AnsiLowerCase(Edit1.Text));
Splitted := MyString.Split([' ']);
for I := Low(Splitted) to High(Splitted) do
Begin
with DBAdvGrid1.Filter.Add do
begin
condition := Splitted;
Data := fcRow;
//column := 3;
Operation := foAND;
end;
End;
DBAdvGrid1.FilterActive := True;
end;
The above works fine as I type search text in Edit1 the Grid filters and narrows down properly. However if I uncomment the Column = 3 and comment out the Data := fcRow line then the grid becomes empty as soon as I type anything in Edit1.
The above works fine as I type search text in Edit1 the Grid filters and narrows down properly. However if I uncomment the Column = 3 and comment out the Data := fcRow line then the grid becomes empty as soon as I type anything in Edit1.
Column 3 in the grid contains the Values that I want to filter upon.
I have tried changing the column to other columns as well but the behavior remains same.
Kindly advise what I should change to be able to filter on just one column and not all columns of the grid.
Also as an aside, is there a better (more efficient) approach to achieve the filtering.
I have tried changing the column to other columns as well but the behavior remains same.
Kindly advise what I should change to be able to filter on just one column and not all columns of the grid.
Also as an aside, is there a better (more efficient) approach to achieve the filtering.
Thanks
Manish