I use BINDEVENTs for our base grid class. I bind to several events -- LostFocus is one. It is bound to Grid.ControlLostFocus().
In ControlLostFocus I have
WITH This
AEVENTS(oEvents,0)
IF VARTYPE(oEvents[1])=="O"
oControl = oEvents[1]
oColumn = oEvents[1].Parent
ELSE
oColumn = NULL
oControl = NULL
ENDIF
IF NOT ISNULL(m.oColumn)
IF oControl.BaseClass = 'Container'
ControlField = xxx
ELSE
ControlField = xxx
ENDIF
.ControlCursorObject.Valid(m.ControlField)
ENDWITH
where the ControlCursorObject is one of our cursorAdapter classes.
My point is you can intercept here and do different behaviors depending on the control object's name or controlSource, etc.
>Dear all,
>
>I am adding number of columns to the grid programatically and issue bindevent event to the valid method of thetextbox
>What will be the workaround if I used bindevent() to the Valid method to make it fire. as if there was no code in the native valid event it will not fire. This is according to the help on bindevent()..."Certain events such as When and Valid require code in the event for it to occur."
>
>Indeed when I try to put in one of the column.text1.valid "nodefault" the assign method fired. but how can i put the 'nodefault' if I add some column programatically.
>
>Thanks in advance.
>
>Regards,
>Ed
Charlie