listview Overview


The wrapper for list views (also known as list controls) allows basic operations on items plus support for list views with checkboxes.

When searching or inserting items the values for each column can be specified in one single string, separated by a special character. Each method which handles multiple strings also accepts a value for the separator character. If it is not supplied the default separator is '|'.

Example

// Test count
    if (ListView.count != 3)
        Env.LogError("ListView item count is different");

// Insert an item with two columns using the default separator
    ListView.newItem("new|item");
    if (ListView.findItem("new|item") == -1)
        Env.LogError("Could not find new inserted item");

// Test findItem with regular expressions and default separator
    var index = ListView.findItem("\\.*|\\.*second.*");
		

Methods

newItem Inserts a new item in the list and returns its zero-based index.
deleteItem Deletes the specified item.
resetContent Deletes all items in the list.
ensureVisible Scrolls the specified item into view.

Properties

count Returns the number of items in the list.
item Gets/sets the text of the item at the specified row and column.
itemData Gets/sets the user data for the item at the specified row and column.
check Gets/sets the checkbox for the specified row, if the list view has checkboxes.
findItem Returns the index of the specified item, or -1 if none exists.
selected Gets/sets the selection on an item (or all items) in the list view.
selectedItems Returns a collection of the selected items in a multiple selection list view, or the index of the current selection in a single selection list.

 


© 2003 Lightweight Technologies. All rights reserved.