Einar,
I haven't tried your code, and can't see anything wrong just looking at it. However, have you considered putting the grid on the page in the form designer and setting visible=.F.? Then if the user needs to see it your only code is to set visible = .T.
Also, have you looked in the debugger to see if the grid is there but not visible to you for some reason? The code for top or left may be wrong, or you may have a ZOrder problem.
HTH
Barbara
>The following code is supposed to display a grid on a page depending on user selection. It does initialize, but why does it not show?
>
>IF !(Type('this.pageframe1.page2.'+grdClass)='O') && add new grid
> this.pageframe1.page2.addobject(grdClass,grdClass) &&same name
>ENDIF
>temp=this.currentbrowse
>IF TYPE('temp')='C'
> this.pageframe1.page2.&temp..visible=.F.
>ENDIF
>this.currentbrowse=grdClass
>WITH this.pageframe1.page2.&grdClass
> .top =this.pageframe1.top+10
> .left =this.pageframe1.left+50
> .height=this.pageframe1.height-10
> .width =this.pageframe1.width-60
> .visible=.T.
>ENDWITH