C1DataViews of C1DataViewSet can be set up to operate either as independent rowsets or to be involved in a master-detail relationship. In the latter case, the behavior of the detail view has the following specifics:
- The set of rows accessible by means of detail view (that is, represented to bound controls and programmatically in the C1DataView.Rows collection) is restricted by the rows which are children for the current record of the master view. Note that the current view record is programmatically accessible through the Current property and can be changed through the Position property. You can still retrieve and use the CurrencyManager for these purposes, but C1DataView provides everything you need, making accessibility much easier.
- When a new row is added to a detail view, its foreign key field value is automatically filled with the corresponding primary key value of the current row of the master view (foreign key inheritance).
You can easily add a view as a detail of another view by selecting a master view in the C1ViewSetDesignerForm and pressing the Add View toolbar button. The master view is one of the C1DataViews, either simple or composite, that you create when you click the Add View button. See C1DataView Definitions for additional information on adding C1DataViews.