DBAdvSearchEdit

Hello,

I have a DBAdvSearchEdit component in a small delphi Form
It is linked to a datasource that have about 300 lines
I set 3 columns on the DBAdvSearchEdit

The first time and each time I open this Form: it works fine
As soon as the windows is displayed, I can drop down and read the data.

But if I need to refresh the data ?
I put a button on this Form and wrote:
pgquery.close;
pgquery.Open;

But it's very slow to refresh the data: I need to wait about 3-4 second to see the data again ?
I tried with pgquery.refresh but same result

So , what is the best practice to refresh the data after the windows is opened ?

Regards

Can you try:
TDBAdvSearchList(DBAdvSearchEdit.SearchList).Reload;

It's working, but I have the same delay. About 3-4 second to refresh the data.

Very strange, when the data are loaded the first time, it's instant

But when I reload there is some delay ?

I retested this here with the demo under DBAdvSearchList where there is a DBAdvSearchEdit used.
I added the code:

procedure TForm1.Button1Click(Sender: TObject);
begin
  TDBAdvSearchList(DBAdvSearchEdit1.SearchList).Reload;
end;

and this reloading is instant.
What is different in your project?

Hello,

I found something very interesting.

I decided to do the same function with the other component (DBAdvSearchList) to see how it's working

And it was the same result as the DBAdvSearchEdit component: when I want to refresh the data , the behaviour of the component was weird ! And a lot of time to refresh.

And finally I found something:
The problem comes from the horizontal scrolling bar. If you see these bar at runtime: it doesn't work.

If you set the total width of the component greater than the sum of the widths of each column so that the horizontal scrolling bar is not be visible at runtime: it work fine with no delay

I did the same setting with the DBAdvSearchEdit component and it works fine also.

Here is my code to refresh the data with DBAdvSearchEdit component:

DBAdvSearchEdit1.ListSource.DataSet.DisableControls;
DBAdvSearchEdit1.ListSource.DataSet.Close;
DBAdvSearchEdit1.ListSource.DataSet.Open;
TDBAdvSearchList(DBAdvSearchEdit1.SearchList).Reload;
DBAdvSearchEdit1.ListSource.DataSet.EnableControls;

Here is my code to refresh the data with DBAdvSearchList component:

DBAdvSearchList1.DataSource.DataSet.DisableControls;
DBAdvSearchList1.DataSource.DataSet.Close;
DBAdvSearchList1.DataSource.DataSet.Open;
DBAdvSearchList1.Reload;
DBAdvSearchList1.DataSource.DataSet.EnableControls;

Regards

That indeed appears to slowdown the loading of items.
We applied an improvement for this that will be included in the next release.
Immediate workaround you can apply:

DBAdvSearchList.BeginUpdate;
DBAdvSearchList.Reload;
DBAdvSearchList.EndUpdate;