*grid.init-in your case would be with this.parent and no for each * unless you want it to apply all columns For each oColumn in this.Columns With oColumn lcType = type(.Controlsource) lnDotPos = at('.',.Controlsource) lcField = substr(.Controlsource,lnDotPos+1) lcTable = left(.Controlsource,lnDotPos-1) lcSampleText = '' lcFont=.FontName lnSize=.FontSize Do case Case lcType = "C" Select max(txtwidth(trim(&lcField), lcFont, lnSize)) ; from (lcTable) ; into array arrTemp .Width = .Parent.Gridlinewidth*2 + ; arrTemp[1,1] * fontmetric(6, .FontName, .FontSize) Case lcType = "M" lcSampleText = replicate("HI",20) Case lcType $ "DT" lcSampleText = transform(eval(.Controlsource)) * case ... Otherwise *... Endcase If !empty(lcSampleText) .Width = .Parent.Gridlinewidth*2 + ; txtwidth(lcSampleText, .FontName, .FontSize) * ; fontmetric(6, .FontName, .FontSize) Endif Endwith EndforIf you want this to occur in header code than probably you'd want to change header class with a custom one. Or use one of Nick Neklioudov's magic :) Check for that in files section (sorry I'm not a PUTM and not easy for me to get a ref to file).