Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Option button deselect
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01229161
Message ID:
01229371
Views:
25
>>First immediate idea - have this option group as a separate class with preselected Option 1. Additional advantages of this approach - you can easily add functionality if needed.
>>
>>BTW, is this column bound? What field it is bound to?
>
>yes the column is bound to a cursor: Here is how my cursor is created:
>
>
>CREATE CURSOR crs_whs (crsinst  C(20), crsprod C(20), crswhs C(5), crswho C(3), crsdte datetime, crsrequestamt n(6), crsiid i, crspid i, crsird i, crsaccptamt n(6), ;
>			crsitem l, crsbox i, crsdelivertype c(1))  && create cursor structure
>
>....
>
>SELECT crs_grid1
>				
>REQUERY('lv_whs_request')
>INSERT INTO crs_grid1 (crsinst, crsprod, crswhs, crswho, crsdte, crsrequestamt, crsiid, crspid, crsird, crsaccptamt, crsdelivertype) SELECT * from lv_whs_request
>
>	SELECT crs_grid1
>....
>
>		.column8.controlsource = "crs_grid1.crsbox"		
>		IF TYPE('.Column8.Text1.name') = 'C'
>			.Column8.RemoveObject('Text1')
>		ENDIF
>		IF !TYPE('.Column8.optiongroup1.name') = 'C'
>			.Column8.NewObject("optiongroup1", "Optiongroup")
>		ENDIF
>.....
>
>
>If I create a class, how would I called it into the grid? I was wonder also if I could just populate the "crsbox" with value 1 and maybe it will pick it up for my defaults.
>
>thanks
>nick

To use your option group class in a grid simply put
IF !TYPE('.Column8.optiongroup1.name') = 'C'
			.Column8.NewObject("optiongroup1", "MyClass",'MyClasslIb.vcx')
		ENDIF 
Yes, you need to pre-populate your field with 1, if 1 is None.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform