angular: automatic grid height ag

I want to change the height of ag-grid depending on the height of the content. At this moment I have fixed it at 500px. And there is a scroll bar. I have tried height=auto Y height=100%

The row size changes with the content it contains. And there are 10 rows on each page. I have also tried domLayout="autoHeight" but it won't work for> 1000 rows and I have more than 4000 rows. What should I do to remove the scroll bar?