>I want to add a "Valid" procedure/method to Column1 in the following simplified dynamic grid code. I do not understand the syntax to add such a procedure at this level.
>
>Suggestions will be greatly appreciated.
>
>Thanks
>
>====================================================
>frmMyForm = CREATEOBJECT('Form') && Create a Form
>
>
>frmMyForm.Width = (_Screen.Width/10)*8
>frmMyForm.Height = (_Screen.Height/10)*8
>
>
>
>frmMyForm.SHOW
>
>
>local llFirstRun, llNotLockedHere
> m.llNotLockedHere = frmMyForm.LockScreen
> m.llFirstRun = .T.
>
>
> if PEMSTATUS(frmMyForm, 'LOB', 5)
> m.llFirstRun = .F.
> frmMyForm.LockScreen = .T.
> frmMyForm.LOB.Visible = .F.
> frmMyForm.RemoveObject('LOB')
> endif
>
>frmMyForm.AddObject('LOB','myGrid')
>
>with frmMyForm.LOB
> .Top = 10
> .Left = 02
> .Width = frmMyForm.Width/2
> .Height = frmMyForm.Height/2
>
> .RecordSource = "LOB"
> .ColumnCount = 12
> .RowHeight = 25
> .FontSize = 8
>
> .Column1.ControlSource = (.RecordSource+'.LBCOMPANY')
> .Column1.Width = 25
> .Column1.Header1.Caption = 'CO#'
> .Column1.Alignment = 3
>
>
> .Visible = .T.
>
>endwith
>
>
>
>if !m.llFirstRun
> frmMyForm.LockScreen = m.llNotLockedHere
>endif
>
>
>READ EVENTS && Start event processing
with .Column1
.AddObject('myText','myText')
.CurrentControl = 'myText'
.myText.visible = .t.
.Sparse = .f.
endwith
define class myText as TextBox
procedure Valid
endproc
enddefine
However I never suggest to use valid in grid.
Cetin