Hello,
I have a SfComboBox that have multiselection option.
Now i need to make search in my database depends on the selected items in the combobox.
I did that query but it seems not working:
"select * from BuyInvoices where InvoiceNum like N'%" & (sfComboBox1.Text) & "%" & "'" & " and Status = 'True' order byInvoiceNum"
I've tried also:
sfComboBox1.SelectedItemsfComboBox1.SelectedValuesfComboBox1.SelectedIndex
Hi Mohamed Maghrabi,
In SfComboBox Multiselection, the highlighted item is stored in the SelectedItems collection, while the items we checked are saved in the CheckedItems collection.
To get all the selected items in multiple selection, please use CheckedItems property.
Please
refer to the documentation for further details
URL: https://help.syncfusion.com/windowsforms/combobox/selection#accessing-the-checked-items
SelectedItem, SelectedValue and SelectedIndex properties are used for single selection.
URL : https://help.syncfusion.com/windowsforms/combobox/selection#getting-the-selected-index
Regards,
Mahalakshmi Sugumar
Thanks for your reply
But can you give me an example code in VB.NET to call the checkeditems from SfComboBox
Thank you
Hi Mohamad,
We are validating your request. We will update your requirement within two days. We appreciate your patience until then.
Regards,
Mahalakashmi Sugumar
Hi Mohamad,
Please refer to the below code for Checked Items collection event, you can get
the selected items in Checked Items property.
Code:
sfComboBox1.CheckedItems.CollectionChanged +=
CheckedItems_CollectionChanged
Private Sub CheckedItems_CollectionChanged(ByVal sender As Object, ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
foreach(Object
item in sfComboBox1.CheckedItems)
{
}
End
Sub
Please refer to the documentation link below for further details
Regards,
Mahalakshmi Sugumar