SfDatagrid auto height (fill parent control)

Goodmorning,

How can I set the height of the datagrid so that it fills the entire space of the parent control (grid or

VerticalStackLayout)?

Thanks. Regards.

Roberto


3 Replies

RM RiyasHameed MohamedAbdulKhader Syncfusion Team April 24, 2025 09:16 AM UTC

Hi Robert Becchetti,
We would like to inform you that you can use a Grid as the parent of the DataGrid, or as the element that provides the available height.
For example, when using a StackLayout as the parent, it provides an infinite height to the DataGrid, resulting in the DataGrid rendering with a fixed height. On the other hand, if you use a Grid, it provides the available size, allowing the DataGrid to occupy the full available space.
Therefore, we recommend using a Grid with a RowDefinition set to *, which will allow the DataGrid to take up the entire available space.

Regards,
Riyas Hameed M




RB Roberto Becchetti April 24, 2025 05:02 PM UTC

It works.

Thanks. Best regards,

Roberto



RM RiyasHameed MohamedAbdulKhader Syncfusion Team April 25, 2025 05:19 AM UTC

Robert Becchetti,

You are welcome! Glad to hear you got it working. Please let us know if you need further assistance. As always, we are happy to help you.


Regards,
Riyas Hameed M


Loader.
Up arrow icon