mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.88k stars 1.17k forks source link

[data grid] Allow for expressing the grid height in number of visible rows #13143

Open Janpot opened 1 month ago

Janpot commented 1 month ago

Summary

Looking for a way to set the height of the grid based on the desired amount of rows to be visible at once. A heightInRows (better name required) prop that takes an amount of rows and sizes the grid to accommodate for this exact amount. To avoid a small space underneath the last row.

This would play well with the autoPageSize property to have a grid that sizes and paginates on a predefined amount of rows. autoHeight together with pagination is not enough as it can't account for height during loading, or for fewer items on the last page.

Perhaps it would even make sense to overload the autoHeight property to take a number?

Examples

I guess the best analogy would be the rows property of the native textarea

Motivation

No response

Search keywords: rows height

michelengelen commented 1 month ago

Added it to the board! 👍🏼