Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid - replacing text boxes with my text boxes...
Message
 
 
À
28/02/2002 11:46:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00626348
Message ID:
00626508
Vues:
35
>Hi Chris.
>
>>> So to my question... I have this in the init of my grid (don't worry about the highlighting - I have stripped that out for ease of readablitlity...) <<
>
>You do realize, of course, that implementing this way will cause you to lose any code that you may have added in any of your grid text boxes. This is not a big deal, if the entire grid is being generated dynamically at run time.
>
>If you are building your grids visually, you may wanted to consider writing a builder that makes this replacement for you at design time instead of at runtime.

Yes, and here is the one:
********************************************************************
*  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
				if type(.controlsource)<>"L"
					if type('oColumn.text1')="O" and lower(.text1.baseclass)='textbox'
						.removeobject('text1')
						.newobject('text1','EditInGrid','nAdditions.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
				.name = "col"+proper(justext(.controlsource))
				.Header1.fontbold = .t.
				.Header1.alignment = 2
			endwith
		next
	endif
next
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform