)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the selected values in the WinForms MultiSelectionComboBox?

Platform: WinForms |
Control: MultiSelectionComboBox |
Published Date: September 1, 2015 |
Last Revised Date: January 7, 2020

 

Show the selected item in ListBox

You can get the selected values in the MultiSelectionComboBox by using the SelectedItems or the VisualItems property.

C#

//Gets the Visual items in the MultiSelectionComboBox.
foreach (VisualItem obj in this.multiSelectionComboBox1.VisualItems)
{
    //Adds the selected item in the ListBox.
    listBox1.Items.Add(obj.Text);
}
//Gets the selected items in the MultiSelectionComboBox.
foreach (object obj in this.multiSelectionComboBox1.SelectedItems)
{
    //Adds the selected item in the ListBox.
    listBox1.Items.Add(obj.ToString());
}

VB

'Gets the Visual items in the MultiSelectionComboBox.
For Each obj As VisualItem In Me.multiSelectionComboBox1.VisualItems
    Microsoft.VisualBasic.ChrW(84)
    listBox1.Items.Add(obj.Text)
Next
'Gets the selected items in the MultiSelectionComboBox.
For Each obj As Object In Me.multiSelectionComboBox1.SelectedItems
    'Adds the selected item in the ListBox.
    listBox1.Items.Add(obj.ToString())
Next obj

 

Selected item displayed in ListBox

Figure 1: Selected item displayed in ListBox

Samples:

C#: MultiSelectionComboBox_SelectedValue_C#

VB: MultiSelectionComboBox_SelectedValue_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Thomas Pagram
May 09, 2016
This seems to be how to retrieve selected display members rather than selected values? Reply
Keerthana Jegannathan [Syncfusion]
May 11, 2016
Hi Thomas, We have prepared sample to based on reported requirement and please make use of the sample in below location Delimiter Mode: http://www.syncfusion.com/downloads/support/directtrac/general/ze/Delimiter_Mode663476532 VisualItem: http://www.syncfusion.com/downloads/support/directtrac/general/ze/Visual_Item1804265812 Regards, Keerthana
Sandesh Daddi
Sep 15, 2016
Hi Geeks, 

I have recently started using MultiSelectionComboBox, 

1. Currently I have set DisplayMode = DelimiterMode
2. To Select item, I am typing 3-4 charactes in textbox and then using Keyboard up/down arrow to go to specific item
3. Then I am pressing "Space Bar" to select the item. 
4. Same for 3-4 items 
5. Then I am pressing "Esc" to move focus and then "Tab" to select other control. 

After this my control only returns last selected item and not all the values. 

I am doing any thing wrong ? 

Also I would like to know, Can I use DiasplayMode = VisualItem and allow user to enter in textbox to search items?

Below is my current settings

  this.employeeFilterCombo.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.None;
            this.employeeFilterCombo.BeforeTouchSize = new System.Drawing.Size(541, 26);
            this.employeeFilterCombo.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
            this.employeeFilterCombo.DisplayMode = Syncfusion.Windows.Forms.Tools.DisplayMode.DelimiterMode;
            this.employeeFilterCombo.EmptyResultText = "No Employees Found";
            this.employeeFilterCombo.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.employeeFilterCombo.Location = new System.Drawing.Point(421, 27);
            this.employeeFilterCombo.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
            this.employeeFilterCombo.Name = "employeeFilterCombo";
            this.employeeFilterCombo.ShowCheckBox = true;
            this.employeeFilterCombo.Size = new System.Drawing.Size(541, 26);
            this.employeeFilterCombo.TabIndex = 9;
            this.employeeFilterCombo.UseVisualStyle = true;
            this.employeeFilterCombo.VisualItemBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));

I have also tried example link from below but facing same issue.

https://www.syncfusion.com/kb/5399/how-to-get-the-selected-values-in-the-multiselectioncombobox


Keyboard is killing me. 
Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon