>>An
elegant solution would have been nice, yes. ;).
>>
>>>I had the same _exact_ problem. I couldn't understand it at all because my grid class _used_ to work then one day I get that Expression not valid crap!
>>>
>>>I recreated the grid class and I copied all of the default code to the proper methods. I bet you wanted to here something a bit more
eloquent yes? :)
>
>The eloquent (or elegant, or vice versa :) solution would be if the grid didn't reference itself as This. For your case
>
>ThisForm.TheGrid.setall("DynamicBackColor","IIF(RECNO()=ThisForm.TheGrid.nRecNo,RGB(0,255,255),ThisForm.TheGrid.BackColor)","column")
>
>...but the drawback is that this will work for all the grids named exactly TheGrid, and for no others. Another solution would be to have something like
>
>this.setall("DynamicBackColor","IIF(RECNO()=this.nRecNo,RGB(0,255,255),this.BackColor)","column")
>grid::refresh()
>nodefault
>
>in your grid.refresh event code, so this expression will be interpreted ( eval()ed, IMO) from within the grid code (and not from the form code) so expression containing "This.whatever" would evaluate to grid.whatever and not to form.whatever.
Thanks! I'm giving this bit of code a try now.