ComponentOne DataObjects for .NET
GetChildRows Event (C1DataSetLogic)

C1.Data.2 Assembly > C1.Data Namespace > C1DataSetLogic Class : GetChildRows Event
Used to programmatically specify the list of child rows for a relation.
Syntax
'Declaration
 
Public Event GetChildRows As GetListEventHandler
public event GetListEventHandler GetChildRows
Event Data

The event handler receives an argument of type GetListEventArgs containing data related to this event. The following GetListEventArgs properties provide information specific to this event.

PropertyDescription
This argument contains the list of rows. In events returning a list, create a new ArrayList object, fill it with rows and assign to the List argument. In events returning a single row (for example, GetParentRow:C1DataSetLogic event), add a single row to the list.  
The name of the relation (in GetRows:C1DataView event, empty if the view is not a child view).  
The row on which to base the list. In GetParentRow:C1DataSetLogic event, the parent row of the view, if it is a child view. In GetChildRows:C1DataSetLogic event, the parent row for which to return child rows.  
Remarks
This event can be used to create custom view relations, when the rule defining the list of child rows for a parent row cannot be formulated based on a simple relation between tables. For example, see CustomRelations sample in the Samples directory, where a custom relation is used to represent a many-to-many relation.

If the C1.Data.SchemaObjects.ViewRelation.GetRowsEvent property is set to True for a view relation, the GetChildRows event is called every time C1DataObjects needs to obtain the list of child rows for a parent row for that relation. Event code sets the argument e.List to a list of rows, thus defining the child rows of the relation. The resulting list, if not empty, must contain C1DataRow objects belonging to the child table view of the relation.

See Also