Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox in grid 'uncheckable'
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00952596
Message ID:
00952616
Views:
7
Hm, the runnable_sample.prg below works for me (does not exactly meet your specs though).
Two ways to make the checkbox behave read/only seem to be from the command window:
oForm.Grid1.Column2.Check1.Visible=.F. && not likely
oForm.Grid1.Column2.ControlSource = "unexpected" && as Alessio pointed out


-Stefan
PUBLIC oForm
oForm = CREATEOBJECT('TestForm')
oForm.Show()
RETURN

DEFINE CLASS TestForm as Form
AutoCenter = .T.
PROCEDURE Load
	LOCAL i
	CREATE CURSOR temp (test C(10))
	FOR i = 1 TO 10
		INSERT INTO temp VALUES (SYS(2015))
	ENDFOR
	SELECT *, ;
		TYPE('temp.test') = 'N' ;
		from temp INTO CURSOR SQLResult READWRITE
ENDPROC

ADD OBJECT Grid1 as Grid WITH ;
	Left = 5, Top = 5, ;
	ColumnCount = 2, ;
	RecordSource = 'SQLResult'
PROCEDURE Grid1.Init
	WITH This.Column2
		.AddObject('Check1','Checkbox')
		.CurrentControl = 'Check1'
		.Sparse = .F.

		.Check1.Visible = .T.
	ENDWITH

ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform