tspeich
2017-07-19T14:39:52Z
I have a grid that has 80 plus columns. One of those columns needs to be a combo that contains 5 values. I can create the combo, and add a row to the grid. If I go no further than adding the row, the combo behaves as expected, all items are present. The problem occurs when I retrieve data from the database and try to populate the grid row with the data.
The code below is from a test.

iGrid1.Clear True
iGrid1.Combos.Clear


With iGrid1.Combos.Add("recheck")
.AddItem "Routine","0"
.AddItem "After Warning","1"
.AddItem "Immediate Response","2"
.AddItem "Immediate Response Confirm","3"
.AddItem "Reinstatement","4"
.AutoAdjustWidth
End With

With iGrid1.AddCol("P1WISCRCK","Wisc Recheck")
.eType = 1
.sCtrlKey = "recheck"
End With

iGrid1.AddRow

strValue = "1"

iGrid1.CellComboListIndex(1,"P1WISCRCK") = CLng(strValue) // This line results in script error 'Object doesn't support this property or method:
Igor/10Tec
2017-07-20T15:53:38Z
This code does not fail in my VB6 test project. The cell contains the correct text "After Warning" after executing this code.

Can you publish or send us a project that causes the problem on your pc?

Tell us also the full version number of iGrid you are using. Note that CellComboListIndex appeared only in the v6.5.
tspeich
2017-07-20T16:04:57Z
Version 5.00 build 0081 is what I have in my current development environment, so the error would make sense.
I have now downloaded the correct .chm for my version of iGrid. I am able to get things working correctly in a test form, but my actual application is still seeing issues.

Application consists of 2 iGrids, One visible and one hidden, both are loaded with the exact same columns and cell values for tracking what was changed by the user.
I use 3 scripts for working with the iGrids
1. Initialize - I set various iGrid properties such as RowMode = False...etc. I use the first block of code below to create the Combo Objects. I also have sub routines created
in the Initialize script that are called by other sripts to format and load the cell values
2. AddColumn - Columns are dynamically loaded from a record set in the database, I set default properties for the columns within this script.
3. LoadGrid - takes in a record set and passes the data to the Sub Routines in the Initialize script that handles formatting the data and loading the cells

One of the attached files is a screen shot of the results of the code shown below, The behavior I see now is the equivalent of a combo box with 6 items that have no ItemText specified.

**executed within the Initialize script
With iGrid1.Combos.Add("recheck")
.AddItem "","-1"
.AddItem "Routine","0"
.AddItem "After Warning","1"
.AddItem "Immediate Response","2"
.AddItem "Immediate Response Confirm","3"
.AddItem "Reinstatement","4"
.AutoAdjustWidth
End With

**Executed from within the Add Column script
If cKey = "P1WISRCK" Then
With iGrid1.AddCol(cKey,cHeader,100)
.eType = 1
.sCtrlKey = "recheck"
End With
With iGrid2.AddCol(cKey,cHeader)
.eType = 1
.sCtrlKey = "recheck2"
End With
End If

***Executed from within a sub routine that lives in the Initialize script
If strCol = "P1WISRCK" Then
If IsEmpty(strValue) False
iGrid1.CellValue(vRow,strCol) = strValue
iGrid2.CellValue(vRow,strCol) = strValue
End If
ElseIf IsEmpty(strValue) = False Then
iGrid1.CellValue(vRow,strCol) = strValue
iGrid2.CellValue(vRow,strCol) = strValue
Else
'Do Nothing
End If
iGrid1.CellAlignH(vRow,strCol) = 1

  ComboCode.txt (1kb) downloaded 63 time(s).
ComboSnippet.jpg

Click to View Image60 View(s)

tspeich
2017-07-20T19:05:38Z
Also the development platform we use is CA Plex, which is code generation application, so I do not have a "project" that I could send
Igor/10Tec
2017-07-22T07:35:00Z
At first sight, your code looks correct and the drop-down list should display item texts. It may be a problem of your specific development environment. Perhaps, it intercepts some Windows messages we process to draw the combo box content, or something like that.

To be totally sure, try to recreate your problem in Microsoft Excel VBA. If your code does not work in this development environment too, then you will have a project you can send us for the further consideration.

Try also to do that with the latest version of iGrid (v6.5). The demo version of this OCX is deployed and registered in your system when you install the latest iGrid demo. As always, you can find it on our Download  page.
tspeich
2017-07-22T23:56:54Z
I was able to resolve the issue on my own, moving the create combo object code into the same script that creates the column resolved.