The following example shows how to create combo box in the first column. To try the example, place a SGGrid on a form. Paste the code into the Declarations section and press F5.
Private Sub Form_Load()
Dim ctl As SGControl
Dim vis As SGValueItems
Dim i As Integer
Set ctl = SGGrid1.Columns(1).Control
'create combo box control
ctl.Type = sgCellDropDown
'set size of combo list
ctl.Height = 2200
ctl.Width = 2200
ctl.PopupAlignment = sgPopupLeft
ctl.PopupStyle.BackColor = QBColor(14)
ctl.PopupStyle.Font.Size = 15
ctl.PopupStyle.Font.Name = "Arial"
ctl.SortOrder = sgNoSorting
'set value items
Set vis = SGGrid1.Columns(1).ValueItems
For i = 1 To 50
vis.Add i, "Item " & i, Me.Icon
Next
Set vis = Nothing
Set ctl = Nothing
End Sub
Back to topic