How can I make dhtmlXWindows resize to fit grid size?

I have a grid in modal dhtmlXWindows. I show / hide rows in the grid based on user selections. I need the window to resize to fit the grid after rows are hidden / shown. Is there a way to do it?

There is no such built in functionality.
The best what can be achieved - do the next after row hiding
- take new height of grid as
grid.entBox.offsetHeight
- use setDimension method of window , to apply new height value