I have a TAdvGridFilterPanel with a grid coupled. In the grid are about 77000 rows with each 12 columns. Applying a filter takes about 3 to 4 seconds which is OK. Restoring the filter takes over 30 seconds!
When I combine more than 1 entry in the Filter the Apply takes a very long time too and the restore doubles it's time.
Is grid.FilterType = ftSuppress?
Yes, it's the same grid and filter as in the previous question about selection of suppressed rows
I will need more details. I cannot see restoring a filter needing so much time here.
Test code on a default grid with 10000 rows:
procedure TForm1.Button1Click(Sender: TObject);
begin
AdvStringGrid1.FilterType := ftSuppress;
advstringgrid1.Filter.Clear;
advstringgrid1.Filter.Add;
advstringgrid1.Filter.Items[0].Condition := '>50';
advstringgrid1.Filter.Items[0].Column := 1;
advstringgrid1.FilterActive := true;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
t: longint;
begin
t := gettickcount;
advstringgrid1.FilterActive := false;
caption := (gettickcount - t).ToString;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
advstringgrid1.RowCount := 10000;
advstringgrid1.RandomFill(false,100);
end;
Takes less than 1000milliseconds to remove the filter
We have near to 8 times more rows in our grid. Could you try and increase the row count? B.t.w. setting the same filter again by clicking 'Apply filter' more than double the time needed to apply the filter (again).
Hi Bruno,
I've created a project that reproduces the problem.
Regards,
Paul
TMSGridFilterTest.zip (37.2 KB)
I've found the problem using elimination of the properties set. This piece of code causes the delay with filtering.
advstringgrid1.FilterType := ftSuppress;
B.t.w.: we are still at 10.6.4.0 with Rad Studio 10.4.2.
Can we use 10.8.5.0 with Rad Studio 10.4.2?
We found a drastic performance improvement for FilterType = ftSuppress that can now remove the filter for 80000 rows in +/- 100ms.
Next TAdvStringGrid version will have this performance improvement.
With no unexpected issues, Nov 22.
I would like to assess the changes in the VCL Ui Package. Can I find the release notes somewhere online? I did find the (i) icon in the Subscription Manager but that only shows the issues and doesn't give me the possiblity to f.i. search etc.
I also notice strange behavior when scrolling the grid when the filter is active. Could be related. Without the filter scrolling with the mouse wheel is fluent. With the filter active it stutters.
Could be related to large nr of rows filtered (invisible) and needing to be skipped during scrolling.