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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBox Multiple Selections

Thread ID:





74750 Jun 26,2008 03:38 PM UTC Jun 30,2008 01:21 PM UTC WinForms 1
Tags: GridControl
Edward Wilkerson
Asked On June 26, 2008 03:38 PM UTC


I have existing ComboBox's in a GridControl written in VB. I now want to enable multiple selections within the ComboBox using the CTRL key. I then need to store the selected rows of the ComboBox into a field in a table. Any help you might offer would be appreciated.

Sri Rajan [Syncfusion]
Replied On June 30, 2008 01:21 PM UTC

Hi Ed,

Thank you for your interest in Syncfusion products.

Combobox does not support multiple selection. But you can achieve this by hiding the default dropdown which is displayed when dropdown button in the ComboBox is clicked. Then showing the listbox for multiple selection, and display the selected items in the cell.
Please refer the below code for more details.

Private Sub l_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell
flag = 0
End Sub
Private Sub l_SelectedValueChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell
If (Me.gridControl1(cc.RowIndex, cc.ColIndex).CellType = "ComboBox") Then
Dim str As String = ""
For i As Integer = 0 To l.SelectedItems.Count - 1
str += l.SelectedItems.Item(i).ToString()
Next i
Me.gridControl1(cc.RowIndex, cc.ColIndex).Text = str
End If
End Sub

Private flag As Integer = 0
Private Sub gridControl1_CellButtonClicked(ByVal sender As Object, ByVal e As GridCellButtonClickedEventArgs)
l.DataSource = list
l.Height = 70
Dim x As Integer=(e.Button.Bounds.X+e.Button.Bounds.Width)-l.Width
Dim y As Integer = (e.Button.Bounds.Y + e.Button.Bounds.Width)
l.Location = New Point(x,y)
If flag = 0 Then
flag = 1
End If
End Sub

Private Sub gridControl1_CurrentCellShowingDropDown(ByVal sender As Object, ByVal e As GridCurrentCellShowingDropDownEventArgs)
e.Cancel = True
End Sub

Here is the minimal sample which implements this task.

Please let me know it this helps.

Best Regards,


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.

Please sign in to access our forum

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

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