Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To: Hijack the Column.Init() from Column.txtbox.init() i
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
How To: Hijack the Column.Init() from Column.txtbox.init() i
Miscellaneous
Thread ID:
00774641
Message ID:
00774641
Views:
60
Hi all

How can I set the InputMask of the column programatically from a textbox which is contained in this column. What is happening is that the InputMask at the time of Column.Init() takes over the this.parent.InputMask specified by the textbox.init(). The below codes though does not fail is serverly delayed in execution for it to work:

textbox.init():
LOCAL llRetVal

DO CASE
	CASE "amount"$LOWER(THIS.COMMENT) OR "amt"$LOWER(THIS.COMMENT)
		THIS.INPUTMASK = goApp.GetSetting("General", "Amount Format", "99,99,99,999.99")

	CASE "quantity"$LOWER(THIS.COMMENT) OR "qty"$LOWER(THIS.COMMENT)
		THIS.INPUTMASK = goApp.GetSetting("General", "Quantity Format", "9,99,99,999.999")

	CASE "rate"$LOWER(THIS.COMMENT)
		THIS.INPUTMASK = goApp.GetSetting("General", "Rate Format", "99,99,999.9999")
ENDCASE

IF THIS.PARENT.CLASS = "Column"
	THIS.PARENT.INPUTMASK = THIS.INPUTMASK
ENDIF

llRetVal = DODEFAULT()

RETURN llRetVal
What IMO happens is that the column is already init()ed and the InputMask, if any, specified in the column takes precedence in the display and any further modifications, as in this case, to the Column.InputMask doe not have any effects.

I use drag-n-drop of grid and it's column. Though I have worked on a grid builder which replaces the textboxes with the textboxes from my library, how to go about hijaking column classes.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Next
Reply
Map
View

Click here to load this message in the networking platform