I'm rather new using ClientDataSets and Delphi 6 for database
applications and I've been trying to get filters to work on a nested
dataset but to no avail.
Here is what I'm trying to do:
I create filter strings for the master and the detail datasets. I assign
the filter string to the master dataset, so that it will get filtered
first. I have also created an OnFiltered handler for it, in which I
attempt to get the current master dataset record and access its
NestedDataSet field and filter it. I would then like to test if this
detail dataset contains any records, as resulting from the application
of the filter and then decide whether to accept the master record after all.
This scheme does not work. Inspecting the datasets coming in the various
OnFiltered events, I can see that the detail dataset is not completely
available and its' RecordCount is 0. Also, it doesn't look like the
detail dataset is changing to point to the proper one nested in each
master record. I keep getting some sort of default record, looks like
the one linked to the last current in the master dataset.
So, has anybody had this sort of trouble before ? How do you handle
filtering in a nested dataset ?
Thanks in advance.