ComponentOne DataObjects for .NET
Custom View Relations
DataObjects for .NET (Enterprise Edition) > Schema Objects > View Relations > Custom View Relations

A custom view relation is not based on any simple relation between tables. It is used when you need a more complicated algorithm than simple equality of table fields. In a custom view relation, the set of child and (optionally) parent rows is defined in code in special events.

Note: For an example where a custom relation is used to represent a many-to-many relation that cannot be based on a single simple relation between tables, see the CustomRelations sample, which is installed with the Studio for WinForms samples.

A view relation is considered custom if its GetRowsEvent property is set to True. Then it uses GetChildRows event to obtain child rows, and, if OneWay = False, it uses GetParentRow event to obtain parent row. If OneWay is set to True, the relation is one-way, only child rows are defined, and the parent row is not accessible from a child row.

To create a custom relation, drag an arrow from parent to child table view in a data set diagram using the Relation button on top of the data set editor. Select the arrow to set properties. Specify the Name property, set GetRowsEvent to True (leave the Relation property empty). Use a C1DataSetLogic component attached to the data set to write code in the events GetChildRowsGetParentRow specifying the algorithm for obtaining child rows and (optionally) the parent row for this relation.