Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Combobox to allow typing and selection from drop down
posted

Hi Team,

I'm in need of having a combobox. The features of combobox are listed below

1. Combobox should allow user to type

2. It should have drop down list to select

3. It should not display toggle button.

Attaching screenshot for reference.

Default look: 

Having list: 

Parents
  • 1560
    Offline posted

    Hello,


    I have been looking into your requirements and created a small sample with XamComboEditor in order to demonstrate how the described functionalities could be achieved.


    Your first requirement to allow typing in the combo could be achieved by setting the XamComboEditor's IsEditable to True.

    Regarding your second requirement, you could bind the combo to data using its ItemSource property and set the DisplayMemberPath property to the required value.

    Your last requirement about not displaying the drop-down button could be achieved by setting the XamComboEditor's DropDownButtonDisplayMode to "Never".

    For the purposes of the example, I enabled the autocomplete mode and disabled the filtering of the items in the drop-down so all of them would be visible when the drop-down is opened.


    More about adding and configuring XamComboEditor could be found in this section of our documentation that you might consider useful.


    Additionally, a list of all properties and events of the XamComboEditor could be found here.

    I have attached a sample application below. Please test it on your side and let me know if I may be of any further assistance.

    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer

    0675.XamComboEditor_sample.zip

Reply Children
  • 1560
    Offline posted in reply to Vignesh J

    Hello,


    I have been looking into your issues and tested the sample under version 19.2, however, on my side, everything works as expected and the DropDownButtonDisplayMode is available. You could check
    this in this topic in our documentation where could be found a list of all properties of XamComboEditor in version 19.2.


    Please make sure that the following assemblies are added to your references:
     
      - InfragisticsWPF.dll
       
    - InfragisticsWPF.Controls.Editors.XamComboEditor.dll
     
      - InfragisticsWPF.DataManager.dll


    Regarding your second question, I am not sure what is your exact requirement. In the previously provided sample, you could type a value that is not on the list. If you do not require to have AutoComplete, you could set the AutoComplete property to False. In case you want to add an item to the list, in case it is not already included,, there is an exposed property of xamComboEditor - CustomValueEnteredAction. It allows you to specify how the control will behave when your end-user types in the control’s text box.


    The CustomValueEnteredActions enumeration allows for three behaviors.

       - Ignore: Default; if the character that you are typing does not match the filter criteria, then the control won’t allow you to continue typing. The invalid values will be automatically removed from the text box.
       - Allow: This option allows you to type data but the typed text will not be included in the items collection.
       - Add: If the value you typed is not in the underlying items collection, this new value will be added to it.


    However, please keep in mind that in case of a collection with fixed capacity (e.g. Array), the CustomValueEnteredAction Add is not applicable.


    More about CustomValueEnteredAction could be found here.


    I have modified the previously attached sample and it could be found below. Please test it on your side and let me know if I may be of any further assistance.


    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer
    8154.XamComboEditor_sample.zip