This is a migrated thread and some comments may be shown as answers.

how to make Grid height dynamically changes?

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
YN
Top achievements
Rank 1
YN asked on 24 Jul 2019, 11:17 PM

Hi Telerik expert,

Could you please educate me how to make Grid height dynamically change ?

like attached picture, if we have 2 rows, only show 2 rows height, if we have 40 rows, show 30 in first page, 10 in second page.

Thank you!

 

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 25 Jul 2019, 12:38 PM
Hi Sarah,

If declaring the height of the grid is omitted, it would automatically adapt its height according to the number of items within its data source. However, this would allow it to stretch until all of the content is shown. That is why, I can recommend setting the max-height CSS rule which would prevent the grid from stretching:

<style>
  .k-grid-content {
    max-height: 200px;
  }
</style>


Regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
YN
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or