>>>Hi. I have code in a method that reads someething like:
>>>ThisForm.pgItems.conItems.grdQuoteList.Column9.visible = .t.
>>>
>>>When I run the code, I get the message that Column9 is not found.
>>>
>>>Does anyone have any ideas how I can make column9 visible (with no error).
>>>
>>>Thanks, Randy
>>
>>Randy,
>>In VFP7 making a column.visible = .f. is nonsense
>
>Well not really. It leaves the column as-is but disappears the data in the column.
>Randy, you sure you haven't renamed the column like ".colQuoteVal"?)
>
>You can always access the nth column via the .columns() array.
>
>i.e. ThisForm.pgItems.conItems.grdQuoteList.Columns( 9).visible = .t.
>
>However it won't disappear the col. I'd suggest Fabio's .Width soln.
>
>>>
>
>
>so I think you don't have that column at all. If you mean you have less than 9 columns then you can do:
>>.ColumnCount = 9
>>
>>Cetin
That's what I meant! "It leaves the column as-is but disappears the data in the column." so isn't it nonsense to use visible = .f.? IOW it is not invisible now. It's still there visible.
I thought the grid had less than 9 columns now (it was a workaround for column.visible=.f. in VFP7) hence no column9 nor Columns(9).
PS: Width = 0 was not a solution. Just try with a grid that has many columns and try setting all but first and last to inivisible using width method. The only reliable solution was ordering visible columns to leftmost positions and setting columncount to visible count.
Cetin