Bruno Montalvan
For some reason I can't display the column Warehouse in the iGrid.

- This is my combo fine.

With .Combos.Add("ComboWarehouse")
  While Not rsAlmacen.EOF
     .AddItem sItemText:=rsAlmacen!DescrpWarehouse, vItemValue:=rsAlmacen!IdWarehouse
  With .Font
    .name = "Arial Narrow"
    .Size = 10
  End With
End With

- And this is my warehouse column code, but the field column is "blank". I've noticed that field is sorted in the iGrid....Please help me to show this column correctly with the combo option for edit.

.AddCol sKey:="DescrpWarehouse", sHeader:="Warehouse", eHeaderAlignH:=igAlignHCenter, lWidth:=50).eAlignH=gAlignHCenter
With .ColDefaultCell("DescrpWarehouse")
 .eAlignV = igAlignVCenter
 .eType = igCellCombo
 .eTypeFlags = igComboBtnFlat
 .sCtrlKey = "ComboWarehouse"
End With
What do you mean when writing "the field column is blank"? By default the combo button isn't displayed in a combo box cell until you select it - unless you set the ShowControlsInAllCells property to True.

Can you tell us how you populate the DescrpWarehouse column? It would be nice to see a sample we can launch to reproduce the problem.
Bruno Montalvan
I mean the field is empty, doesn't show any data.


criteRio = "SELECT * FROM table"
Set rsRepuestos = Nothing
rsRepuestos.Open criteRio, cn, adOpenStatic, adLockReadOnly
With igRepuestos
        .Clear bRemoveCols:=False
        .FillFromRS rsRepuestos
End With

The button displayed is not the problem. The combobox show the data correctly. But the Grid doesn´t show it.

I attach 2 images, with combo (column is empty), and without combo (column show data correctly)

Almacén = Warehouse
Bruno Montalvan attached the following image(s):
I guess I know why this happens. Look at the following statement you use to add items to your combo:

.AddItem sItemText:=rsAlmacen!DescrpWarehouse, vItemValue:=rsAlmacen!IdWarehouse

In fact, the rsAlmacen!IdWarehouse expression is not a field value, it is a whole ADODB field object! The Value property is its so called default property that is used implicitly if you assign this expression to another variable of an elementary data type like String or Integer. But in this context the vItemValue argument is Variant, and you store the whole field object in the combo.

If I'm right, the code should look like this:

.AddItem sItemText:=rsAlmacen!DescrpWarehouse, vItemValue:=rsAlmacen.Fields("IdWarehouse").Value
Bruno Montalvan
Thanks for responding.
Not working, I still have the problem.

I need edit the table using combobox within the grid.

Do you have an example using the combo with database?.
I use visual basic 6 with acces 2007, ADO connection.

I will appreciated your help.
I've looked into all samples we have for VB6 and VBA, but unfortunately I could not find a ready sample with a combo list populated from a db. But in any case, I think, we need to make YOUR sample work. Can you prepare and send us a project that demonstrates the issue to our main support email address?
Bruno Montalvan
I attach a vb6 project, with my example, something I'm doing wrong, please help me.

File Attachment(s): (263kb) downloaded 126 time(s).
If I get you right, you need to use the combo list to select a warehouse in the idWarehouse column. Then the corresponding code snippet that creates the column set should look like this:

.AddCol sKey:="ID", sHeader:="ID", lWidth:=70
.AddCol sKey:="Company", sHeader:="Company", lWidth:=100
.AddCol sKey:="IdWarehouse", sHeader:="IdWarehouse", lWidth:=70
With .ColDefaultCell("IdWarehouse")
   .eAlignV = igAlignVCenter
   .eType = igCellCombo
   .eTypeFlags = igComboBtnFlat
   .sCtrlKey = "ComboWH"
End With

It works.
Bruno Montalvan
Thank you so much...