Public oForm >oForm = Createobject('myForm') >oForm.Show > >Define Class myForm As Form > DataSession = 2 > ShowTips = .T. > Procedure Load > Use employee > Endproc > Add Object myGrd As myGrid With RecordSource = 'Employee' >Enddefine > >Define Class myGrid As Grid > DeleteMark = .F. > ReadOnly = .T. > RecordMark = .F. > ScrollBars = 3 > SplitBar = .F. > Highlight = .F. > HighlightRow = .F. > Name = "grdMyGrid" > > Procedure AddColumn > Lparameters nIndex, cAlias, cField > Nodefault > This.AddObject("clm"+cField,"myColumn", cAlias+"."+cField,nIndex) > Endproc > > Procedure Init > Lparameters tcRecordsource > tcRecordSource = Iif(Empty(m.tcRecordSource),This.RecordSource,m.tcRecordSource) > With This > .ColumnCount = -1 > .RecordSource = tcRecordsource > nOldColCount = .ColumnCount > For ix = 1 To Fcount(tcRecordsource) > .AddColumn(ix, tcRecordsource,Field(ix,tcRecordsource)) > Endfor > .ColumnCount = nOldColCount > .SetAll('Visible',.T.) > Endwith > Endproc > > Procedure When > Set Cursor Off > Endproc > > Procedure Valid > Set Cursor On > Endproc >Enddefine > >Define Class myColumn As Column > Resizable = .F. > Movable = .F. > Procedure Init > Lparameters cControlSource, nIndex > With This > .ControlSource = cControlSource > .ColumnOrder = nIndex > .RemoveObject('Header1') > .AddObject('myHeader','myHeader') > .AddObject("myText","myGridTxtBox") > .CurrentControl = "myText" > .Sparse = .F. > Endwith > Endproc > Procedure MouseMove > Lparameters nButton, nShift, nXCoord, nYCoord > With This.Parent > lnActiveRow = Ceiling( ; > ( nYCoord - (.Top + .HeaderHeight) ) / .RowHeight ) > lnActivecol = This.ColumnOrder - This.Parent.LeftColumn + 1 > .ActivateCell(lnActiveRow,lnActiveCol) > Endwith > This.myText.ToolTipText = ; > iif(Type(This.ControlSource)='C', Eval(This.ControlSource),; > iif(Type(This.ControlSource)='M', Mline(Eval(This.ControlSource),1),'')) > Endproc >Enddefine > > >Define Class myGridTxtBox As TextBox > Procedure Init > This.BorderStyle = 0 > Endproc > Procedure Click > This.SetFocus() > Endproc >Enddefine > >Define Class myHeader As Header > Procedure Init > This.Caption = Proper(Justext(This.Parent.ControlSource)) > Endproc >Enddefine >Cetin