Xceed Grid for WinForms v4.3 Documentation
SearchMode Property


Xceed.Grid.v4.3 Assembly > Xceed.Editors Namespace > WinComboBox Class : SearchMode Property
Gets or sets a value indicating the mode to use when searching for items in the combobox.
Syntax
'Declaration
 
<DescriptionAttribute("Indicates the mode to use when searching for items in the combobox.")>
<CategoryAttribute("Behavior")>
Public Property SearchMode As SearchMode
'Usage
 
Dim instance As WinComboBox
Dim value As SearchMode
 
instance.SearchMode = value
 
value = instance.SearchMode
[Description("Indicates the mode to use when searching for items in the combobox.")]
[Category("Behavior")]
public SearchMode SearchMode {get; set;}

Property Value

A SearchMode value indicating the mode to use when searching for items in the combobox. By default, DefaultSearchMode.
Remarks

To enable search mode, the AllowFreeText property must be set to false.

Items are searched for according to their string representation which is determined by the WinComboBox control's DisplayFormat property. For example, let's assume that the WinComboBox has 3 columns and 3 items with the following values:


Plante, Martin, 34
Drimonakos, Mathieu, 24
Ledoux, Pierre-Luc, 25

If the DisplayFormat property is set to "%Column2% %Column1% %Column3%", the string representation of the items will be:


Martin Plante 34
Mathieu Drimonakos 24
Pierre-Luc Ledoux 25

Entering "p" in the WinComboBox control will select "Pierre-Luc Ledoux 25" rather than "Martin Plante 34" because the string representation of the items is used rather than the physical order of the values/colums. If the DisplayFormat had not been modified, "%Column1%, %Column2%, %Column3%", "Plante, Martin, 34" would have been selected and not "Ledoux, Pierre-Luc, 25".

The value of the CompareType property can influence the search behavior. By default, the CompareType property is set to CompareType.ExactMatch, therefore cases and accents are respected. Setting the CompareType property to CaseInsensitive, AccentInsensitive, or both will change the way in which items are searched for. For example, if the CompareType property is set to AccentInsensitive, accents contained in the string representation of an item will be ignored, resulting in "ö" and "o" being considered as equal values.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

WinComboBox Class
WinComboBox Members