Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keytrapping in a Grid
Message
 
 
To
17/07/2002 11:09:29
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00679588
Message ID:
00679620
Views:
49
This message has been marked as a message which has helped to the initial question of the thread.
If you want to do it in design-time, you may use code, similar to this (on the form select a grid - cick on it):
********************************************************************
*  Description.......: GridBuilder - allows to build a grid in design-time
*  Calling Samples...:
*  Parameter List....:
*  Created by........: Cetin Basoz
*  Modified by.......: Nadya Nosonovsky 10/25/2001 04:14:31 PM
********************************************************************
*custom builder not registered
aselobj(arrObj)
for each oObj in arrObj
	if upper(oObj.baseclass)='GRID'
		for each oColumn in oObj.columns
			with oColumn
*			    .name = "col"+proper(justext(.controlsource))
				.Header1.fontbold = .t.
				.Header1.alignment = 2
				.Header1.caption = proper(justext(.controlsource))
				
				if type(.controlsource)<>"L"
					if type('oColumn.text1')="O" and lower(.text1.baseclass)='textbox'
						.removeobject('text1')
					*	.newobject('text1','EditInGrid','nAdditions.vcx')
						.newobject('text1','InGrid','wgcontrols.vcx')
					endif
				else && Logical field
					if type('oColumn.text1')="O" and lower(.text1.baseclass)='textbox'
						.removeobject('text1')
						.newobject('check1','checkbox')
						.check1.caption = ''
						.sparse = .f.						
					endif
				endif				
			endwith
		next
	endif
next
>>Hello Nadya
> Should the grid be built from code rather than using the Builder? I'm not really sure how to get my own textbox into a column on a grid other than building it through code.
>
>You should use your own textbox in Grid's columns instead of normal textbox. In this textbox KeyPress method you would program the behavior, you want. For validation records in grid see yesterday's message from Marcia Akins.
>>
>>>I am currently working with a grid where a user would like to do quick data entry, validate the data from existing tables and add new records while in the grid. Since KEYPRESS event doesn't function withing a grid ( at least I haven't been able to get to work ), if I want to trap for say the INS key being pressed, is it best to do it in the Beforerowcolchange method using LASTKEY() ?
>>>
>>>Thanks to all
>>>Regards,
>>>Carmen
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform