ComponentOne List for WinForms
Integration with C1Combo / User Interaction
In This Topic
    User Interaction
    In This Topic

    The Combo control provides various features such as automatic completion, limit to list, and much more to enhance the user experience. The following sections discuss how to use these features.

    Automatic Completion

    The Combo control supports automatic field completion using AutoCompletion property of the C1Combo class. The AutoCompletion property controls whether matching incremental search values are automatically copied to the text portion of a combo box during editing. By default, the AutoCompletion property is set to false, and automatic completion is disabled. However, you can enable automatic completion by setting the AutoCompletion property to true. Additionally, you can use MatchCompare property of the C1Combo class to enhance field completion, as it complements auto complete by enabling input string matching within a string in Combo.

    In the auto completion mode, when the user enters one or more characters that match a value in the combo box's list, the entire matching string is copied to the text portion of the control as shown in the following GIF.

     Automatic Completion

    Use the following code to enable automatic completion in the Combo control

    C#
    Copy Code
    //enable automatic completion
    c1Combo1.AutoCompletion = true;
    

    Limit User Entry

    The LimitToList feature prevents users from entering an item which does not appear in the combo box list. To enable this feature, you can set LimitToList property of the C1Combo class to true. Setting this property to true does not allow the users to change the text to something that does not appear in the combo box list.

    The following code demonstrates how to set the LimitToList property.

    C#
    Copy Code
    //enable automatic drop-down
    c1Combo1.AutoDropDown = true;
    

    Automatic Drop-down

    By default, the contents of the combo list box are not visible, unless you press the drop-down arrow. However, you can change this default behavior by setting AutoDropDown property of the C1Combo to true. Setting the AutoDropDown property to true automatically opens the drop-down list when the user types a character into a cell.

    The following code demonstrates how to enable AutoDropDown property in the C1Combo.

    C#
    Copy Code
    //set LimitToList property
    c1Combo1.LimitToList = true;