Another alternative if levels are sequential is to use an array property. ie:
dimension thisform.aColors[5]
thisform.aColors[1]=rgb(Level0Color)
thisform.aColors[2]=rgb(Level1Color)
thisform.aColors[3]=rgb(...)
...
myGrid.SetAll('DynamicBackColor','thisform.aColors[myTable.Level+1]')
Cetin