>Ed,
>>>
>>>I want to add method to my grid class, which allows me to change captions in all columns of the grid to be proper of the original content, i.g.
>>>Before
>>>stnum| street |stnumext
>>>After
>>>Stnum|Street|Stnumext
>>>
>>>The problem is that I don't know all my collumns names and headers names. What is the easiest way to achieve this functionality?
>>
>>Why don't you simply spin through the Columns collection? Each column should have a control derived from the Header class, by default named "Header1", usually as the 1st control in the Column's COntrol array.
>
>Thanks for your reply. Yes, it works:
>
>local i
>with this
>for i = 1 to .columncount
> .columns(i).controls(1).caption = Proper(.columns(i).controls(1).caption)
>endfor
>endwith
>
>
Nadya, I'd recommend at least checking the base class - grids which have been instantiated in a custom fashion may not have the header as the first control in the column's Controls collection. YMMV. The name does not have to be "Header1", either - look at the control's BaseClass property.
You can also use a FOR EACH loop on a collection rather than explicit iteration.