AdvDBFilterDialog and ClientDataSet

Does AdvDBFilterDialog work with ClientDataSet?

A quick test of:

Drop a TDBGrid , TClientDataSet, TDatasource, TAdvDBFilterDialog and a TButton on a form.

Preload the CDS ("load mybase data") with saved data.

Connect grid and adbFilterDlg to datasource.

Button1Click =
  AdvDBFilterDialog1.execute;

Run program.
Click button1 - dialog box appears, columns are filled in as expected.

Enter a filter condition and "apply filter" - grid shows filtered data.

Close advDBFilterDialog.

Click button1 again - dialog box appears - but NO filter information.

I
see a comment indicating "The AdvDBFilterDialog will get & set the
Table.Filter, so you can use this value to pre-populate the
AdvDBFilterDialog."

( From: http://www.tmssoftware.com/SITE/forum/forum_posts.asp?TID=5678&title=advdbfilterdialog-case )

Is this "pre-populate" supposed to work with CDS?

Thanks!

(BTW,  I still think the Filter Operations needs a "not contains" op).

Cheers,
EdB






BTW, just replaced the CDS with a FDConnection and FDQuery and re-ran the project. It works flawlessy ("pre-populates" as expected).

Unfortunately, I can't change the CDS in the production project...

EdB

I did a bit of checking- FQueryString is cleared in AddClear (which then
copies the empty FQueryString to DataSet.Filter. FQueryString is only set in
blocks where "hasSQL" is true. Using a CDS, hasSQL is always false.

I don't see anywhere that the existing dataset.filter is preserved before AddClear is called.

I also tried with FDTable.

If
the FDTable has a filter set before calling AdvDBFilterDialog1.execute,
the filter is properly parsed and displayed in the Filter panel dialog. 
However, changing the filter and clicking "Apply filter" does nothing.

There appears to be a few issues here...

EdB