Added Tree Grids

Added an example and modified code to support tree grids.