AlexT
  • AlexT
  • Member Topic Starter
2018-11-12T09:24:09Z
Hello

I might need some help with the use of Combo Box Cells. This Excel 2016 + VBA.

I have a need to setup a two column list that would show a text in column 1 and a Combo in column 2:

Something like

Text ! Combo !
Text1 ! < combo > !
Text2 ! < combo > !
Text3 ! < combo > !

So I'm defining my combo like this:

With igGUI.Combos.Add("GUI")
   .AddItem sItemText:="Left-aligned", vItemValue:="Available"
   .AddItem sItemText:="Left-aligned", vItemValue:="Disabled"
   .AddItem sItemText:="Left-aligned", vItemValue:="Hidden"
   .AutoAdjustWidth
End With

Then the grid as

With igGUI.AddCol(sKey:="field_name", sheader:="Field Name", lMaxWidth:=200, eHeaderAlignH:=igAlignHCenter)
    .eType = igCellText
End With

With igGUI.AddCol(sKey:="cmb_use", sheader:="Use", eHeaderAlignH:=igAlignHCenter)
   .eType = igCellCombo
End With

One I have this for testing purposes I do

For i = 1 To 10
    igGUI.AddRow
    igGUI.CellValue(i, 1) = "test " & i
    igGUI.CellValue(i, "cmb_use") = "Available"
Next i

Everything seems to execute correctly - however when I show my form I see

VB form

Note that the combo field does not show any value...

Worse clicking on said field will crash Excel - oops.

PS: for some reason I had to try many time to post this message as it is apparently triggering anti spam detection - extremely irritating !


Igor/10Tec
2018-11-12T14:42:34Z
You forgot to specify the combo you want to use in the Use column:

With igGUI.AddCol(sKey:="cmb_use", sheader:="Use", eHeaderAlignH:=igAlignHCenter)
   .eType = igCellCombo
   .sCtrlKey = "GUI"
End With

The crash is a problem of iGrid, but it has been already fixed in the build 6.50.0080 in September this year. The crash occurred if a combo cell did not have an attached combo list, which is not a normal situation, but we fixed this problem in any case.


Quote:

PS: for some reason I had to try many time to post this message as it is apparently triggering anti spam detection - extremely irritating !



You already reported this problem in another thread on this forum, and we answered that it is a problem of the YAF forum engine used to run this forum. This issue will be reported to the YAF developers and we hope this problem will be fixed in the next YAF update.