FindItem Method

Returns the index of the list item that matches the string specified.

Client support

   Newlook Smartclient only.

Syntax

listview object.FindItem(string[, matchType][, startIndex][, partial])

The FindItem method syntax has these parameters:

Part

Description

string

Specifies the string to be matched.

matchType

Optional. A constant specifying where to search for the string. This argument may be set to one of the pre-defined matchType constants. If omitted, the string will be matched to the Text property of the ListItem.

startIndex

Optional. Specifies where the search will begin. This can be either an integer, string or object. If an integer is specified then the search will start at the ListItem whose Index is specified by this value. If a string is specified then the search will start at the item whose Text property matches this string. If startIndex is omitted, then this method will search from the first ListItem in the list.

partial

Optional. A boolean specifying whether the search has to match part or all of the found value. This argument may be set to one of the partial values. If omitted, false is assumed and a match will only occur if the value exactly equals the string specified.

Settings

The matchType argument settings are:

Constant

Value

Description

nllvwText

0

(Default) Search for the string argument in the Text property of the ListItems.

nllvwSubItem

1

Search for the string argument in the Text property of the sub-items.

nllvwTag

2

Search for the string argument in the Tag property of ListItems.

The partial argument settings are:

Value

Description

0

A match will occur if the value begins with the string specified.

1

(Default) A match will only occur if the value exactly equals the string specified.

Use

This method can be used to provide a search tool for users to find items in a list view control, or if you wish to identify a particular item in the list view based on its text value.

Returns

The index of the matched ListItem object.

Applies To

ListView control

See Also

Key property | Tag property | Text property


© 2004-2021 looksoftware. All rights reserved.