Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation in Grid
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Validation in Grid
Miscellaneous
Thread ID:
00706402
Message ID:
00706402
Views:
58
Hi everybody,

We still have VFP6, so here is a code from Marcia Akins which I use for grid's validation:
********************************************************************
*  Description.......: BeforeRowColChange
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Marcia Akins 
*  Modified by.......: 
********************************************************************
LPARAMETERS nColIndex
with this
	if .lValidatingRow
		nodefault
	else
		.nRec2Validate = recno(.recordsource)
		dodefault(m.ncolindex)
	endif
endwith
*!*	********************************************************************
*!*	*  Description.......: AfterRowColChange
*!*	*  Calling Samples...:
*!*	*  Parameter List....:
*!*	*  Created by........: Marcia Akins
*!*	*  Modified by.......:
*!*	********************************************************************
lparameters ncolindex
local lnRec2GoTo
with this
*** If there is no record to validate, exit stage left
	if .nRec2Validate = 0
		return
	endif

*!*	*** Save the current record number in case we have changed rows
	lnRec2GoTo = recno( .recordsource )
*** Check to see if the row has changed
	if .nRec2Validate # m.lnRec2GoTo
*** We are validating the row we are attempting to leave...set the flag
		.lValidatingRow = .t.
*** Return to the record we just left
		goto .nRec2Validate in ( .recordsource )
*** If it checks out, let the user move to the new row
		if .ValidateCurrentRow()
			goto m.lnRec2GoTo in ( .recordsource )
		endif
*** Finished with validation...reset flag
		.lValidatingRow = .f.
	endif
endwith
dodefault(m.ncolindex)
I use my own textbox classes inside the grid columns instead of standard classes. The problem is, that somehow user defined properties became invisible for the grid, e.g. I get errors like property DoValid is not found. My textbox class indeed has this property. Sometimes it's even can not find the grid's custom property.

I was trying to fix this problem by checking for the property existance, but it seems ridiculous, because I know for sure, that my class has this property...

What should I do?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform