Searches each cell in the specified column for a given text string.
DataGridObject.SearchColumn(ColIndex, StartRow, FindText, CaseSensitive)
Newlook Smartclient
Newlook Server
This method is used to search a column for cells with a text value matching the string specified in the method's FindText argument. Only the cells within the specified column will be searched. Note that the comparison must match the whole of the cell's contents (eg. searching for "abc" will not match a cell value of "xabcx").
ColIndex - (Integer, Required)
The index of the column that is to be searched.
StartRow - (Integer, Required)
The index of the row in which to start the search. Specify -1 in this argument to search from the first row.
FindText - (String, Required)
A string containing the text to search for. The string must be specified in quotation marks.
CaseSensitive - (Boolean, Required)
A value which indicates whether the search is case sensitive or not. True requires an exact match whereas False will search for the text irrespective of case (i.e. 'A' matches 'a').
This method returns an integer value representing the index of the first row in which the FindText was found. If the string could not be found this method returns a value of -1.
The following example searches the 5th grid column (the columns have 0 based indexes) for the search string entered by the customer in a custom text box on the form. If not found, the user is alerted. The search begins at the first row of the grid and is not case sensitive. VB SCRIPTSub SearchForText
End Sub |
© 2004-2021 looksoftware. All rights reserved.