GrapeCity MultiRow Windows Forms Documentation
DropDownStyle Property
Example 


Gets or sets a value that specifies the style of the combo box.
Syntax
<SRDescriptionAttribute("Indicates the appearance and functionality of the ComboBoxCell.")>
<DefaultValueAttribute()>
<SRCategoryAttribute("Appearance")>
Public Property DropDownStyle As MultiRowComboBoxStyle
Dim instance As ComboBoxCell
Dim value As MultiRowComboBoxStyle
 
instance.DropDownStyle = value
 
value = instance.DropDownStyle
[SRDescription("Indicates the appearance and functionality of the ComboBoxCell.")]
[DefaultValue()]
[SRCategory("Appearance")]
public MultiRowComboBoxStyle DropDownStyle {get; set;}

Property Value

One of the MultiRowComboBoxStyle values. The default is MultiRowComboBoxStyle.DropDownList.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe assigned value is not one of the MultiRowComboBoxStyle values.
Remarks

This property controls the ComboBoxCell's display and behavior. In the Windows Vista operating system the ComboBoxCell has a different DropDownStyle and the display is obviously different. In the default GcMultiRow.EditMode, if DropDownStyle is MultiRowComboBoxStyle.DropDown, a single click of the drop down button enters edit mode; in other areas, the user needs to double-click. If DropDownStyle is MultiRowComboBoxStyle.DropDownList, a single click in any area causes the ComboBoxCell to enter edit mode.

If you change DropDownStyle to MultiRowComboBoxStyle.DropDownList when the AutoCompleteSource property is not System.Windows.Forms.AutoCompleteSource.ListItems and AutoCompleteMode property is not System.Windows.Forms.AutoCompleteMode.None, the ComboBoxCell changes AutoCompleteMode to System.Windows.Forms.AutoCompleteMode.None automatically.

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

 

 


Copyright © GrapeCity, inc. All rights reserved.