I have code to save the data of an igrid control to a data file.
The igrid uses check boxes in some of the cells.
When I reload the form data, the check boxes always restore as checked, not unchecked.
How can I get it to set the correct state of check boxes as checked or unchecked?
The data format (CelList in code below):
<IGrid1>5|12|1|True||Continuous|Live|0.280|0.000|||||<empty>|2|False|False|Point|Live|0.000|43.800|||29||<empty>|3|True|False|Point|Live|0|43.800|||49||<empty>|4|True|False|Point|Live|3.6|<empty>|||22.67||<empty>|5|True|True|Point|Live|3.6|<empty>|||45.33||<empty>|</IGrid1>
What is saved:
[img=https://drive.google.com/file/d/0B6g56LjIUheNQmZrRVFsQmV1OVk/view?usp=sharing]Saved[/img]
What is restored:
[img=https://drive.google.com/file/d/0B6g56LjIUheNcVNEQUJpdkhlVVU/view?usp=sharing]Restored[/img]
The code to restore the data:
Dim oGrid As TenTec.Windows.iGridLib.iGrid = CType(oChild, TenTec.Windows.iGridLib.iGrid)
If oGrid.ReadOnly = False Then
Dim DL As String = "|", CelList() As String = Split(controlValue, DL), ci As Integer = 2
If CelList.Length > 3 Then
oGrid.Rows.Count = CInt(CelList(0))
oGrid.Cols.Count = CInt(CelList(1))
For r As Integer = 0 To oGrid.Rows.Count - 1
For c As Integer = 0 To oGrid.Cols.Count - 1
If CelList(ci) <> "<empty>" Then
oGrid.Cells(r, c).Value = CelList(ci)
'If CelList(ci) = "True" Then
' oGrid.Cells(r, c).Value = TenTec.Windows.iGridLib.iGBool.True
'ElseIf CelList(ci) = "False" Then
' oGrid.Cells(r, c).Value = TenTec.Windows.iGridLib.iGBool.False
'Else
' oGrid.Cells(r, c).Value = CelList(ci)
'End If
End If
ci += 1
Next
Next
End If
End If
Note I commented out code that didn't seem to work.