Is there a way to maintain grid size when number of rows less than GridPageSettings Page Size?

Hi,

I have a grid that is set to 9 rows and I would like to maintain that size even if there are fewer than 9 rows of data. If I set min size then the number of rows expand in height to fill the space, so if I have a container of 450px and only 5 rows they expand to be 90px each, rather than the required 50px.

If I don't set the min size then the row height is maintained but the container shrinks to the number of rows.

Cheers,

Ben


3 Replies

RS Renjith Singh Rajendran Syncfusion Team January 27, 2022 09:02 AM UTC

Hi Ben, 
 
Greetings from Syncfusion support. 
 
We suggest you to set the Height property for SfGrid to maintain a static height for Grid irrespective of the rows available in Grid.  
 
 
<SfGrid DataSource="@Orders" ... Height="315"> 
    ... 
</SfGrid> 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Renjith R 



BE Ben January 27, 2022 10:34 AM UTC

Thanks Renjith but I don't think this takes different screen resolutions into account. I was hoping there was a way to set a minimum row count that would fill in space for 'empty rows'.



RS Renjith Singh Rajendran Syncfusion Team January 28, 2022 01:52 PM UTC

Hi Ben, 
 
We have documented this topic to dynamically calculate height using calc codes in our documentation. We suggest you to refer the below documentation for applying dynamic height for Grid based on your requirement. 
 
Kindly refer the above documentation and check this from your side, and if you are still facing difficulties or if we have misunderstood your requirement then kindly get back to us with the following details to proceed further. 
 
  1. We are not clear about this query “I was hoping there was a way to set a minimum row count that would fill in space for 'empty rows'.”. Kindly share a detailed explanation or a video demo explaining this query.
  2. Share a detailed explanation of your scenario or requirement.
 
The provided information will help us analyze the problem, and provide you a solution as early as possible. 
 
Regards, 
Renjith R 


Loader.
Up arrow icon