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.
Unfortunately, activation email could not send to your email. Please try again.

How to programmatically select an item in MultiSelectionComboBox?

Thread ID:

Created:

Updated:

Platform:

Replies:

128766 Feb 9,2017 07:21 PM May 3,2017 01:58 AM Windows Forms 3
loading
Tags: MultiSelectionComboBox
Jonathan Martineau
Asked On February 9, 2017 07:21 PM

How to programmatically Select an Item in MultiSelectionComboBox? Only one.

Keerthana Jegannathan [Syncfusion]
Replied On February 10, 2017 06:03 AM

Hi Jonathan,   
   
Thank you for contacting Syncfusion support.   
   
We suspect your requirement is to select the item programmatically in the MultiSelectionComboBox. If so your requirement can be achieved by using the function named “AddVisualItem”. We have prepared a sample in which you can select an item through button click and it can be downloaded from the below location.   
   
Sample: MultiSelectionComboBox   
   
Regards,   
Keerthana J   


Felix Bagur
Replied On May 2, 2017 06:53 AM

Hello,
I think the only way to select an element is:
You must filter the datatable according to its definition, in my case I have a column called "pk".
Then select all the elements (filtered)
And finally put back the original items.

Dim tmp As DataTable = MultiSelectionComboBox1.DataSource()

MultiSelectionComboBox1.DataSource = CType(Me.DataSource, DataTable).Select("pk=2").CopyToDataTable

MultiSelectionComboBox1.SelectAll()

MultiSelectionComboBox1.DataSource = tmp


Vinothini [Syncfusion]
Replied On May 3, 2017 01:58 AM

Hi Felix, 
 
Thank you for your update.  
 
We can also select item in MultiSelectionComboBox using DataTable as you have mentioned in your update. This can also be done by SelectedItem and AddVisualtem property available in the MultiSelectionComboBox as given in our previous update. 
 
Regards, 
Vinothini 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.

;