Dynamically create a grid

Is it possible to create a grid dynamically getting the columns and grid information from the server?
I have the need of getting through Ajax all the data of the grid including the configuration (headings, width, etc).
Is this possible?
if so, any examples or tips on how to do that?

You can configure your grid from the xml:
of from the json: