Hide Grass and Trees applied to terrain?

Hi, In my game I have lots of grass and trees. It runs fine when I play the game but when I am in the editor it is quite laggy. Is there a way to temporarily hide the grass or trees to make it run smooth in the editor?

Terrain / Settings / Tree & Detail Objects / Draw [uncheck]

Does anyone know how to do the same in code? In my game, I scale the world down, but terrain trees and details don’t scale, so I want to hide them only when scaling the world.