GrapeCity MultiRow Windows Forms Documentation
AutoCompleteMode Property
Example 


Gets or sets an option that controls how automatic completion works for the ComboBoxCell (refer to System.Windows.Forms.ComboBox.AutoCompleteMode).
Syntax
<SRDescriptionAttribute("Indicates the text completion behavior of the ComboBoxCell.")>
<DefaultValueAttribute()>
<SRCategoryAttribute("Behavior")>
Public Property AutoCompleteMode As AutoCompleteMode
Dim instance As ComboBoxCell
Dim value As AutoCompleteMode
 
instance.AutoCompleteMode = value
 
value = instance.AutoCompleteMode
[SRDescription("Indicates the text completion behavior of the ComboBoxCell.")]
[DefaultValue()]
[SRCategory("Behavior")]
public AutoCompleteMode AutoCompleteMode {get; set;}

Property Value

One of the System.Windows.Forms.AutoCompleteMode values. The default is System.Windows.Forms.AutoCompleteMode.None.

If you change the AutoCompleteMode property to a value which does not equal System.Windows.Forms.AutoCompleteMode.None, when the AutoCompleteSource property is not System.Windows.Forms.AutoCompleteSource.ListItems, the ComboBoxCell changes DropDownStyle to MultiRowComboBoxStyle.DropDown automatically.

Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe assigned value is not one of the System.Windows.Forms.AutoCompleteMode values.
Remarks
Refer to the System.Windows.Forms.ComboBox.AutoCompleteMode's remarks.
Example
The following code example shows how to customize a combo box cell's behavior or appearance. This code example is part of a larger example provided for the ComboBoxCell class.
ComboBoxCell CreateAutoCompleteComboBoxCell()
        {
            ComboBoxCell comboBoxCell = new ComboBoxCell();

            comboBoxCell.DropDownStyle = MultiRowComboBoxStyle.DropDown;
            comboBoxCell.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            comboBoxCell.AutoCompleteSource = AutoCompleteSource.CustomSource;
            string[] customSourceItems = new string[] { "aaa", "bbb", "ccc", "ddd" };
            comboBoxCell.AutoCompleteCustomSource.AddRange(customSourceItems);

            comboBoxCell.Items.AddRange("(none)", "aaa", "bbb", "ccc", "ddd");

            return comboBoxCell;
        }
Private Function CreateAutoCompleteComboBoxCell() As ComboBoxCell
        Dim comboBoxCell As New ComboBoxCell()

        comboBoxCell.DropDownStyle = MultiRowComboBoxStyle.DropDown
        comboBoxCell.AutoCompleteMode = AutoCompleteMode.SuggestAppend
        comboBoxCell.AutoCompleteSource = AutoCompleteSource.CustomSource
        Dim customSourceItems As String() = New String() {"aaa", "bbb", "ccc", "ddd"}
        comboBoxCell.AutoCompleteCustomSource.AddRange(customSourceItems)

        comboBoxCell.Items.AddRange("(none)", "aaa", "bbb", "ccc", "ddd")

        Return comboBoxCell
    End Function
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

ComboBoxCell Class
ComboBoxCell Members
DataSource Property
Items Property
AutoCompleteCustomSource Property
AutoCompleteSource Property

 

 


Copyright © GrapeCity, inc. All rights reserved.