Dcjones
2015-10-07T17:59:22Z
Hello,

I'm having a problem displaying check boxes for a column on the activex iGrid.
I'm using MS Access 2010 32 bit

The checkbox doesn't display.

I have no idea what I'm doing wrong, it seems to ignore everything except for the row count and adding columns and headers for text columns


grdAddlInsureds.BeginUpdate
   
grdAddlInsureds.RowCount = 3
grdAddlInsureds.GridlineColor = RGB(255, 192, 255)
grdAddlInsureds.CellCheckGap = 5
   
grdAddlInsureds.AddCol sKey:="AddlEndorse", sHeader:="Additional Insured Endorsements", lWidth:=180
grdAddlInsureds.AddCol sKey:="Charge", sHeader:="Charge", lWidth:=60
   
With grdAddlInsureds.AddCol(sKey:="is_Select", sHeader:="Select", lWidth:=80)
   .bCheckVisible = True
   .eCheckPos = igCheckPosTop
   .eAlignH = igAlignHCenter
   .vValue = "Test"
End With
                  
   
grdAddlInsureds.EndUpdate
 
          
SaveSetting "grdAddlInsureds", "Layout", "Columns", grdAddlInsureds.LayoutCol
Igor/10Tec
2015-10-08T06:21:06Z
We always recommend creating rows AFTER you defined your columns. This (1) works faster because of the internal organization of data structures and (2) allows the grid to apply the default column cell settings to new cells.

In your code you define the default cell settings for the check box column is_Select after the cells in this column were created. To make your code work as expected, put the assignment to the RowCount property after you have defined all columns:

grdAddlInsureds.BeginUpdate
   
grdAddlInsureds.GridlineColor = RGB(255, 192, 255)
grdAddlInsureds.CellCheckGap = 5
   
grdAddlInsureds.AddCol sKey:="AddlEndorse", sHeader:="Additional Insured Endorsements", lWidth:=180
grdAddlInsureds.AddCol sKey:="Charge", sHeader:="Charge", lWidth:=60
   
With grdAddlInsureds.AddCol(sKey:="is_Select", sHeader:="Select", lWidth:=80)
   .bCheckVisible = True
   .eCheckPos = igCheckPosTop
   .eAlignH = igAlignHCenter
   .vValue = "Test"
End With

grdAddlInsureds.RowCount = 3   ' <------ Put this after the last AddCol call!
                  
   
grdAddlInsureds.EndUpdate
 
          
SaveSetting "grdAddlInsureds", "Layout", "Columns", grdAddlInsureds.LayoutCol