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. Image for the cookie policy date

How to programmatically select an item in MultiSelectionComboBox?

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

3 Replies

KJ Keerthana Jegannathan Syncfusion Team February 10, 2017 11:03 AM UTC

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   



FB Felix Bagur May 2, 2017 10:53 AM UTC

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



VI Vinothini Syncfusion Team May 3, 2017 05:58 AM UTC

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 


Loader.
Live Chat Icon For mobile
Up arrow icon