ListView.insertItem

Overview | Methods | This Package | All Packages

ListView.insertItem

Inserts an item into the list view control.

Syntax

public ListItem insertItem( int index, ListItem li )

public ListItem insertItem( int index, String text )

public ListItem insertItem( int index, String text, int imageIndex )

public ListItem insertItem( int index, String text, int imageIndex, String[] subItems )

Parameters

index

The zero-based position where you want to insert the item into the list view control.

li

The ListItem object that represents the item to insert into the list view control.

text

The string to display for the list item.

imageIndex

The zero-based index of image within the ImageList object associated with this ListView control.

subItems

An array of strings that represent the subitems of the new item.

Return Value

Returns the ListItem object that represents the item you added to the list view control.

Exceptions

WFCException thrown if the item is already contained in another list view control.

Remarks

If the sorting property of the list view control is set to SortOrder.ASCENDING or SortOrder.DESCENDING, the item is inserted into the list in sorted order. Otherwise, the item is inserted at the specified position.

If you add a list item without specifying an image or subitems, the item is created without associated image or subitems.