Link to home
Start Free TrialLog in
Avatar of pire
pire

asked on

Creating a Combo within a Grid

It is possible in VB6 to insert or create a combo or list box within a Grid (Grid, DBGrid or FlexGrid)? How it is done? I will appreciate a lot if somebody has a link to or the explanation to this process. If not possible, what options do I have to get the result I'm looking (like the combos you find when creating an Access table), within a grid field), or to which object or control should I refer? I thank you all beforehand.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of escheider
escheider

If finances are available, I would suggest looking into this grid control:  http://www.janusys.com/janus/

This is by far the best grid control that I have seen that easily allows you to create drop down combo boxes within the grid.  Lots of other functionality too.
<listening..>
escheider,

i want to clarify that how GridEX updates the content from the frontend (VB) to the backend (SQL Server 2000) through ADO?

Is it using ADO Update method to perform record by record update? We wrote a lots of stored procedures and some data class (VB .cls) to handle database logic. We do not want to grant SELECT right on any of tables.

My question is:
Can GridEX support stored procedures?
Or i just use GridEX as a buffer to show/store the change users made. And then use GetRowData method to perform update logic through excuting suitable stored procedures
'Reference: Microsoft ActiveX Data Objects 2.5 Library

'Place this section at top of form
Private WithEvents rsADOSetRecord As ADODB.Recordset
Private adoDataGrid As ADODB.Connection

Private Sub sbLoadCombo()
Set adoDataGrid = New ADODB.Connection
Set rsADOSetRecord = New ADODB.Recordset
With rsADOSetRecord
.Open "SELECT DISTINCT " & strFiledName & " FROM " & strTableName, adoDataGrid, , , adAsyncFetch
If Not .BOF Then
.MoveFirst
Do While Not .EOF
If .Fields(0).Value <> vbNull Then combo1.AddItem .Fields(0).Value
.MoveNext
Loop
End If
.Close
End With
End Sub