ComponentOne DataObjects for .NET
GetRows Event

C1.Data.2 Assembly > C1.Data Namespace > C1DataView Class : GetRows Event
Used to programmatically specify the list of rows in a data view.
Syntax
'Declaration
 
Public Event GetRows As GetListEventHandler
public event GetListEventHandler GetRows
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 data views in cases where filtering cannot be specified by a simple expression in the RowFilter property or sorting by a list of fields in the Sort property.

The GetRows event is called every time C1DataObjects needs to obtain the list of rows for the data view. It gives the developer an opportunity to specify a list of rows comprising the data view by assigning such list to the e.List event argument. This list can be filtered and sorted in whatever fashion the developer needs it to be, provided it consists of C1DataRow objects belonging to the table view or table on which the data view is based. The list supplied in the event handler will become exactly the list of rows of this data view, unless RowFilter and/or Sort properties are not empty, in which case they are applied to the list of rows resulting from the GetRows event.

Writing code in GetRows event, you can use the e.List argument value passed to the event, which is the complete list of rows as it would appear in the data view if there were no GetRows handler and no RowFilter and Sort properties. You can filter and/or sort this list to obtain your custom list, although this is only one possible technique, you can form the resulting list in any other way you need.

See Also