* grid.init (A grid class with gettag method) set classlib to myheader.prg additive for each oColumn in this columns with oColumn tcCaption = field(ix) && Real implementation has more code here && Getting caption from dbc if type(".Header1") = "O" .removeobject("Header1") .addobject("MyHeader1","myMSelHeader",tcCaption) else .MyHeader1.caption = tcCaption endif * .Myheader1.tagname = this.gettag(.controlsource) endwith endfor *myheader.prg define class myMSelHeader as header tagname="" procedure init lparameters tcCaption this.caption = tcCaption this.alignment = 6 endproc procedure click if !empty(this.tagname) set order to tag (this.tagname) else set order to 0 endif nTempCurrec = recno() this.parent.parent.refresh go nTempCurrec endproc enddefineCetin