Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About grid allowaddnew property
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
About grid allowaddnew property
Divers
Thread ID:
00770674
Message ID:
00770674
Vues:
49
Hi All,
Grid AllowAddNew property still behaviour earlier versions ,
How ? if its .T. grid adding new rows when user press downarrow at the last row on the grid but i heard that it would behaviour delphi's dbgrid or MSAccess grid. Eg. when user press down arrow at the last row will add a new row if nothing happen or changed any fields on the new row and user press up arrow will undo (or delete ) . But i've tried it seems still same.
is there any info about this ? . This feature very usefull coming to me specially at the OneToMany forms to enter detail input. Why not in VFP like delphi or access ?

TIA

PS : I've solved this problem ( via Ed Rauh :(,Nadya and Nancy) with my method but not useful sometimes for eg. i am using textbox class on the grid textbox class uses keypress event for do this action . But init code removes text1's . is there any short way without remove columns and add new textbox class to all columns then change some columns currentcontrol for use requiered keypress event codes ?

my code like below
* grid init 
FOR EACH oColumn IN this.Columns
   WITH oColumn
     .RemoveObject('Text1')
     .NewObject('text1','GrdAddNew','sdbgrid.vcx')       
     .CurrentControl='Text1'
     .text1.visible=.t. 
     ENDWITH
ENDFOR
* GrdAddNew textbox class keypress
LPARAMETERS nKeyCode, nShiftAltCtrl
	LOCAL lcAlias
		lcAlias = THIS.PARENT.PARENT.RECORDSOURCE
		DO CASE
			CASE nKeyCode = 24 && '{DNARROW}'
				* 3 Field in an appended record has not been
				* edited or deletion status has not changed for
				* the appended record.
				IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
					NODEFAULT
				ENDIF
			CASE nKeyCode = 5 && '{UPARROW}'
				IF GETFLDSTATE(-1) = REPLICATE("3",FCOUNT(lcAlias)+1)
					TABLEREVERT(.F., lcAlias)
					THIS.PARENT.PARENT.REFRESH
				ENDIF
		ENDCASE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform