grid.enableAutoHeight in dhxLayout

Is it possible to attach a grid with “enableAutoHeight” to a dhxLayout?

dhxLayout = new dhtmlXLayoutObject(document.body, "2E");
dhxLayout.cells("a").setText("Main Page");
dhxLayout.cells("b").setText("Site Navigation");
mygrid = dhxLayout.cells("b").attachGrid();

In this example, the grid appears without a scrollbar but the Layout does not expand to the size of the grid. Is there a way to also enable auto height to the layout or maybe to get the full height of the grid after loading and then change the size of the layout?

Unfortunately it’s not available use the enableAutoHeight() method in case of attaching grid to a layout.
Unfortunately it is not available to get the height of the grid using the API.
You may use the following solution:

var header_height=parseInt(; var grid_height=parseInt(mygrid.objBox.scrollHeight)+header_height;