Kendo React - Grid - Change grid height dynamically depending on the row height to make table size to size-to-fit

1 Answer 184 Views
Grid
Jason
Top achievements
Rank 2
Iron
Iron
Iron
Jason asked on 29 Jan 2024, 07:15 PM | edited on 29 Jan 2024, 07:16 PM

Greetings,

I have an issue where the grid height does not change correctly when the row height is increased which causes the table to not display all information. User requires to scroll to see the rest of the information (Please see the attached image for example).

The grid is displaying correctly if the row height is using the default value.

Is there a way to make the table size to size-to-fit? Thanks!

 

Jason

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 31 Jan 2024, 08:11 AM

Hello Jason,

The Grid height is usually set explicitly through the "style" property:

      <Grid
        style={{
          height: "400px",
        }}

Without an explicit height, the Grid will render all items:

If you want to dynamically change the height of the Grid, you check the height of the data container when the Grid loads (and after each window's resize event for example) and adjust it accordingly.

Nevertheless, if further assistance on this matter is needed, please share a stackblitz example demonstrating the issue that you are facing, so we can check the exact configuration that you have and give a suggestion for it.

Looking forward to your reply.

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
Grid
Asked by
Jason
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or