SftTree/OCX 7.0

SftTreeItems.FindCellText Method

Softel vdm, Inc.

Searches items for a string.

Syntax       

 

VB.NET

FoundIndex = object.FindCellText(ByVal ItemIndex As Integer, ByVal ColIndex As Short, ByVal SearchString As String)  As Integer

VB

FoundIndex = object.FindCellText(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal SearchString As String)  As Long

C#.NET

int FoundIndex = object.FindCellText(int ItemIndex, short ColIndex, string SearchString);

VC++

long FoundIndex = object->FindCellText(long ItemIndex, short ColIndex, _bstr_t SearchString);

C

HRESULT object->raw_FindCellText(long ItemIndex, short ColIndex, BSTR SearchString, long* FoundIndex);

Delphi

FoundIndex := object.FindCellText(ItemIndex : Integer; ColIndex : Smallint; SearchString : WideString)   : Integer;

object

A SftTreeItems object.

ItemIndex

The zero-based index of the item where the search begins (including ItemIndex).

ColIndex

The zero-based column number to be searched.

SearchString

The text to be searched.

FoundIndex

Returns the zero-based index of the item, where the specified SearchString is found.  -1 is returned if no item is found matching the specified SearchString.

Comments

The FindCellText method searches items for a string.

The string described by SearchString is compared to the Cell.Text property of all items and columns involved in the search.  The search starts at the item described by ItemIndex and is restricted to the column specified by ColIndex.  If an item with a matching Cell.Text property is found, its zero-based index is returned, otherwise -1 is returned.

Only one column can be searched at a time. Items.FindCell can be used to search multiple columns and with additional features not available to FindCellText.

The comparison of SearchString and the Cell.Text property is not case sensitive.  If the Cell.Text property starts with the string in SearchString, it is considered a match.  To find an exact match for SearchString use the Items.FindCellTextExact method.

 

SearchString

Cell.Text Property

Match

Comment

ABC 

abc 

Yes 

Same string, case is ignored

abc 

abc123 

Yes 

Property starts with SearchString

abc 

Thisabc

No

Property doesn't start with SearchString

abc 

ab 

No 

Property doesn't contain the complete SearchString

See Also  SftTreeItems Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com