Hi,
Does anyone received this error message on a Grid?
I have this controls & code on my forms.
1. Combo box => rowsource & rowsourcetype not defined(programmatically set..)
2. Grid control = recordsource & recordsourcetype defined(progr..cally set..)
3. Spinner control
In my form Init procedure, the code is
*/*data are opened already under load event...
With thisform
.cboclients.rowsource = "Alltr(Crmclients.name)"
.cboclients.rowsourcetype = 6
Endwith
On their valid procedure of my combo box, my code is
*/* selected fields are 7...but i shortened it here..
SELECT Name,CHOOSEN FROM CRMCLIENTS INTO CURSOR TMPCRMCLIENT READWRITE
With thisform
.grid1.DeleteMark = .F.
.grid1.RecordMark = .F.
.grid1.ColumnCount = 7
.grid1.AllowAddNew = .F.
.grid1.AllowHeaderSizing = .F.
.grid1.AllowRowSizing =.F.
.grid1.readonly = .F.
.grid1.RecordSource = "TMPCRMCLIENT"
.grid1.RecordSourcetype = 1
.grid1.column1.ReadOnly = .T.
.grid1.column1.Width = 115
.grid1.column1.header1.Alignment = 2
.grid1.column1.header1.Caption = "Name"
IF LEN(TMPCRMCLIENT.NAME)> 16
.grid1.column1.ControlSource = "SUBSTR(Name,1,16)+'...'"
ELSE
.grid1.column1.ControlSource = "Name"
ENDIF
*/* some code blocks
.grid1.column7.ReadOnly = .F.
.grid1.column7.Width = 14
.grid1.column7.header1.Alignment = 2
.grid1.column7.header1.Caption = ".."
IF .grid1.column7.CurrentControl <> "Check1"
.grid1.Column7.AddObject("CHECK1","CHECKBOX")
.grid1.Column7.CurrentControl = "CHECK1"
.grid1.column7.check1.Caption = ".."
.grid1.column7.check1.Value = 0
.grid1.column7.check1.ReadOnly = .F.
.grid1.column7.controlsource = "Choosen"
.grid1.column7.sparse = .T.
Else
.grid1.column7.check1.Caption = ".."
.grid1.column7.check1.Value = 0
.grid1.column7.check1.ReadOnly = .F.
.grid1.column7.controlsource = "Choosen"
.grid1.column7.sparse = .T.
ENDIF
.refresh()
ENDWITH
My problem with this is, when I select a different a client from the combo box the second time, I cannot put a check mark on the grid...it will not have a check mark as if its readonly. Im using check control on my grid for some reason...
If i remove the addobject method, and set the grid current control to "check1", thats the time I get the error message..
Note: Records on my temp cursor change and it varies when values on the spinner control increase or decrease....
Does anyone have this error and manage to solve it?
Please do check whats missing or wrong with my code..
Thanks in advance.
Jojo R. dela Cuesta
Dalplus Technologies
http://www.dalplus.com