CompositeView.InsertItem(Int32, IModelViewItem) Method

Creates a View Item using specified information on it, and inserts it to a Composite View's CompositeView.Items collection at a specified position.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.1.dll

Syntax

public ViewItem InsertItem(
    int index,
    IModelViewItem info
)

Parameters

Type Name Description
Int32 index

A zero-based integer specifying the new View Item's position within the CompositeView.Items collection.

IModelViewItem info

An IModelViewItem object representing the Application Model node with the information on the new View Item.

Returns

Type Description
ViewItem

A ViewItem descendant representing the View Item inserted.

The InsertItem method creates a View Item using information from the Application Model node. This node is passed as the info parameter. The created item is inserted into the current Composite View's CompositeView.Items collection at the specified position by moving all subsequent items to the end of the collection. The index parameter specifies this position. If index is the last in the collection, the View Item is appended to the end.

Adding an item to the CompositeView.Items collection raises the CompositeView.ItemsChanged event.

Generally, you do not need to use this method. Instead, you can add View Items via the Application Model. For this purpose, use the Application | Views | DetailView | Items node.

See Also