We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Fill 100% space of parent

Hi Syncfusion team,

i want fill the entire space of the window with the grid control.

I have downloaded a sample, which has Version 18.1.0.36-beta and it works (Page1 of attached project). 
Unfortunately Page2 doesn't work as expected. On this page I have defined the grid with frozencolumns, so the output of the aggregate function is lost

If i update to a newer version for example 18.3.0.35, the grid is not adjusted to the entire space.

And one more question: Why does syncfusion not provide a GridAttribute, that deals with this functionality.

Thanks in advance


Attachment: SynfusionTest_ee66dc61.rar

1 Reply 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team January 4, 2021 12:38 PM UTC

Hi Gisela, 

Greetings from Syncfusion support. 

We would like to inform you that, by default Grid will be rendered/adjusted based on its parent div element’s width and height. So we suggest you to provide your required width and height values for Grid’s parent div element. Please refer the documentation below, 

We suspect that you would like to dynamically change the Grid’s height based on browser window resize. If, so then we suggest you to set Width and Height for Grid as 100% and define width and height of grid’s parent div element dynamically using calc.  

We are also attaching the modified sample upgraded to our latest version for your convenience. Please download the sample from the link below, 

Please refer and use like the codes below. We have calculated this height for parent div element based on the above attached sample application layout. You can customize this height and width of Grid’s parent div based on your grid and page layout. 

 
@*Calculate the parent div element’s height based on your browser page layout*@ 
 
<div style="heightcalc(100vh - 4rem);"> 
   <SfGrid ID="AppDGContacts2" @ref="GridObj" ... Width="100%" Height="100%" FrozenColumns="2"> 
     ... 
   </SfGrid> 
</div> 

 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer
Loader.
Up arrow icon