Getting Started > Using the True DBList and True DBCombo Controls > Searching the List |
The following properties determine the search behavior of TDBList and TDBCombo controls:
Sets/returns the RowSource field used for incremental search |
|
Sets/returns the type of incremental search (TDBList only) |
|
Sets the search column when the MatchEntry property is not 0 |
|
Sets/returns the comparing mode for search |
Additionally, the Find method allows you to locate the bookmark for a given row. For more information on the Find method, see Searching Bookmarks Using the Find Method.
The optional ListField property specifies which RowSource field should be used for incremental search.If not specified, the first column in the list is used. For instance, consider the example presented earlier.If you set the ListField property of TDBCombo1 to Name, the text portion of the combo displays the Name field instead of PubID.Typing the letter "m" selects M & T; typing the letter "a" selects MACMILLAN COMPUTER.
TDBCombo controls always search incrementally as in this example.TDBList controls support a MatchEntry property, which determines how the list is searched as the user types characters at run time.
If you set MatchEntry to 2 - Extended, the behavior is almost identical to that of a TDBCombo control except that the search argument is cleared when a TDBList control gains focus, or when the user presses Backspace or hesitates for a few seconds. If you set MatchEntry to 1 - Standard, the search argument is limited to one character.You can also disable searching altogether by setting MatchEntry to 0 - None.
By setting the MatchCol, you can allow the end user to perform searches in various columns (depending on which MatchCol option is chosen).
Note: MatchCol is functional only when MatchEntry is NOT set to 0 (None). You can set MatchCol to the following options:
ListField (default) |
The search column is the current ListField. If the ListField is not set, the search column will be the first column. |
Current Mouse Position |
The search column is the column where the mouse cursor is active. |
Current Selected Col |
The search column is the current selected column. If there is more than one selected column, the search column is the left most selected column. |
Left Visible Col |
The search column is the left most visible column. |
Right Visible Col |
The search column is the right most visible column. |
All Cols |
The search columns are all the visible columns. |
By setting the MatchCompare, you can allow the end user access to various search modes, not just the standard incremental search.
Note: MatchCompare is functional only when MatchEntry is NOT set to 0 (None). You can set MatchCompare to the following options:
Partially Equal (Default) |
This is the same as an incremental search. |
Less Than |
Matches strings less than the search value. |
Less Than or Equal |
Matches strings less than or equal to the search value. |
Equal |
Matches strings equal to the search value. |
Greater Than or Equal |
Matches strings greater than or equal to the search value. |
Greater Than |
Matches strings greater than the search value. |
Include Equal (OLEDB) |
Matches the search value within the string. For example, if the search value is “put”, Include Equal will match “computer” because “put” is contained within the string. |