Hello,
When using the new datagrid element, there seems to be a default grid height even when the height is set to ‘auto’.
Is there a way to make it fit better if there are only one or two rows in the datagrid?
Appreciate your help!
Hello,
When using the new datagrid element, there seems to be a default grid height even when the height is set to ‘auto’.
Is there a way to make it fit better if there are only one or two rows in the datagrid?
Appreciate your help!
Hi Sam
Can you check you have modified the “Vertical padding scale” setting, that’s another way to change the row size.
Hi Augustin,
Thanks for your reply. The vertical padding is set to 0. I notice that the vertical padding changes the individual rows, but not the entire datagrid’s height.
Is there another way to make the datagrid fit the data rows even if there are only 1 or 2 rows?
Thanks!
Hello @sampannemans,
It’s a default configuration of AG-grid (the library we are using)
You can force the min-height yourself with two ways:
In both case, you can use this code
.ag-center-cols-viewport {
min-height: unset !important;
}
Thanks so much!
You’re right—AG-Grid does apply a default height even when set to ‘auto’. A quick fix is to manually set a smaller min-height using custom code, especially if your grid only has one or two rows. That way, it fits your content better and avoids the empty space. Hope this helps!
Yes, I added the custom code to unset the min-height. That works fine!
Thanks