Bruno Montalvan
2014-02-05T17:13:05Z
Hi
For some reason I can't display the column Warehouse in the iGrid.

- This is my combo code...works fine.

With .Combos.Add("ComboWarehouse")
  While Not rsAlmacen.EOF
     .AddItem sItemText:=rsAlmacen!DescrpWarehouse, vItemValue:=rsAlmacen!IdWarehouse
     rsAlmacen.MoveNext
  Wend
  With .Font
    .name = "Arial Narrow"
    .Size = 10
  End With
 .AutoAdjustWidth
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
Igor/10Tec
2014-02-06T13:36:02Z
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
2014-02-06T13:52:40Z
I mean the field is empty, doesn't show any data.

Code:

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):
Igor/10Tec
2014-02-07T14:50:00Z
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
2014-02-07T15:13:09Z
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.
Igor/10Tec
2014-02-08T10:13:39Z
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
2014-02-08T19:24:07Z
I attach a vb6 project, with my example, something I'm doing wrong, please help me.

thanks
File Attachment(s):
Demo_Main.zip (263kb) downloaded 114 time(s).
Igor/10Tec
2014-02-10T07:22:22Z
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
2014-02-10T13:17:04Z
Perfect!!!
Thank you so much...