I have a QuantumGrid with two levels (let us say, lvCountries and lvCities) and two views (tvCountries and tvCities respectfully). All properties in both views are set correctly and grid display as it should:
- France
- Paris
- Marseille
- Lyon
- Germany
- Dresden
- Hamburg
etc.
Up to this moment everything has been fine.
But I also have an edit form (activated by a button on a form with the master-detail grid). I'd like to display on this form a new grid with data from current Detail. If in main form France selected, edit form should display only french cities in its grid:
- Paris
- Marseille
- Lyon
I attached the same datasource to edit form's grid as I used for detail view in main form, but it displays all the cities from all the countries.
- Paris
- Marseille
- Lyon
- Dresden
- Hamburg
As I understand, this happens because detail data are filtered not in their datasource, but in their view, and datasource displays all the values from its dataset (I use ADODatasets, by the way).
Is there a way to display detail data on another form only for current master record?
Add a property to your detail form that is set to the key value of the selected record. e.g.
In FormShow
When you call FormDetail :-