Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Why runtime checkbox grid configuration doesn't work ?

Hi Experts

I'm facing a problem while trying to configure a grid control from inside code

User generated image
Here is the Init's code from form1
 
With thisform.pageframe1.page1.grid1
	.ColumnCount = 12
	.Panel = 1
	.LockColumns = 2


	.Column1.Width = 35
	.Column1.Name = "Column1"
	.Column1.Header1.Caption = "Conciliar"
	.Column1.AddObject('Check1','clscheck')	
	.Column1.Check1.Visible = .T.
	.Column1.CurrentControl = 'Check1'
	.Column1.Text1.Visible = .F.
	.Column1.RemoveObject('Text1')
	.Column1.Sparse = .F.
	.Column1.Enabled = .T.

	.Column2.Width = 120
	.Column2.Name = "Column2"
	.Column2.Header1.Caption = "CR"
	.Column2.Enabled = .F.

	.Column3.Width = 120
	.Column3.Name = "Column3"
	.Column3.Header1.Caption = "Dsp"
*--.Column3.Text1.INPUTMASK = "(###)###-####"
	.Column3.Enabled = .F.

	.Column4.Width = 120
	.Column4.Name = "Column4"
	.Column4.Header1.Caption = "Cx"
	.Column4.Enabled = .F.

	.Column5.Width = 80
	.Column5.Name = "Column5"
	.Column5.Header1.Caption = "Dcn"
	.Column5.Enabled = .F.

	.Column6.Width = 70
	.Column6.Name = "Column6"
	.Column6.Header1.Caption = "Dia"
	.Column6.Enabled = .F.

	.Column7.Width = 70
	.Column7.Name = "Column7"
	.Column7.Header1.Caption = "Dt.Lan"
	.Column7.Enabled = .F.

	.Column8.Width = 90
	.Column8.Name = "Column8"
	.Column8.Header1.Caption = "Valor"
	.Column8.Enabled = .F.

	.Column9.Width = 60
	.Column9.Name = "Column9"
	.Column9.Header1.Caption = "Qtd"
	.Column9.Enabled = .F.

	.Column10.Width = 170
	.Column10.Name = "Column10"
	.Column10.Header1.Caption = "Observação"
	.Column10.Enabled = .F.

	.Column11.Width = 120
	.Column11.Name = "Column11"
	.Column11.Header1.Caption = "Saldo"
	.Column11.Enabled = .F.

	.Column12.Width = 120
	.Column12.Name = "Column12"
	.Column12.Header1.Caption = "Empresa"
	.Column12.Enabled = .F.


	*--.SetAll('DynamicBackColor', 'IIF(selecter, RGB(0,219,219), RGB(255,255,255))', 'COLUMN')
	.Visible = .T.
Endwith

Open in new window


 User generated image
The error when it runs doesn´t make sense for me
 User generated image
The class is defined at another place - CLASSES.PRG
Set Procedure To CLASSES Additive  && at main.prg

Any possible reason ?

Thanks in advance !
img-ee-011111.JPG
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Eduardo Fuerte

ASKER

Perfect.
Just FYI, numeric columns are also allowed for checkboxes.
Thank you, Pcelba !
While that's true you better go for boolean. Allowed numeric values are 0 for .F., 1 for .T. and 2 for .NULL.; if you bind a numeric field and it has a different value you get problems again.

Bye, Olaf.