Can I have grid auto size when displaying more rows?

I am using the grid with the toolbar as is shown in the example:
http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/14_loading_big_datasets/10_pro_paging_wt.html.

What I would like to do is have the grid resize in height when the user selects more rows to display. For example, if in the example above, one selects 30 rows to display, I would like the grid to show all 30 rows without any vertical scroll bars.

Is this possible?

dhtmlxGrid doesn’t have appropriate api to change grid container height on runtime. You may change grid container height manually with JavaScript.
To calculate desire height you may use getSelectedRowId method to get number of selected row and multiply it to the grid row height. If you are not using multi line mode, row height is 20px

I will be using multi-line. Is there a way to add up all the row heights to get an exact count?

Also, what events do I need to attach to?

Is there a way to add up all the row heights to get an exact count?
You may iterate through all rows in grid get its offsetHeight. But it may slow down grid performance

Also, what events do I need to attach to?
You can use “onRowSelect” event