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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Calculating Grid Height

Thread ID:





151191 Jan 31,2020 09:29 AM UTC Feb 3,2020 12:41 PM UTC Angular - EJ 2 1
Tags: Grid
Deepak Jain
Asked On January 31, 2020 09:29 AM UTC

Hello Team,

I have to set available container height to Grid, but once I am setting any height to height property for eg. 10. But grid is excluding Header and Footer from this height preference.

I want to set entire grid within 100 with freazed header

Balaji Sekar [Syncfusion]
Replied On February 3, 2020 12:41 PM UTC

Hi Deepak, 
Thanks for contacting us. 
We have validated your requirement. You can achieve your requirement, by dynamically setting the grid height. Please refer the below code example and sample for more information. 
<div class="control-section"> 
    <ejs-grid [dataSource]='data' #grid (dataBound)='dataBound()' allowPaging='true' height='350'> 
. . . 

. . . 
export class AppComponent { 
    public data: Object[] = []; 
   @ViewChild('grid', {statictrue}) 
   public grid: GridComponent; 
    ngOnInit(): void { 
        this.data = orderDetails; 
    dataBound () { 
    let changedHeight = this.grid.element.getBoundingClientRect().height - parseInt(this.grid.height as string); 
//dynamically setting the grid height including header and footer 
    this.grid.height = parseInt(this.grid.height as string) - changedHeight; 

Please get back to us with the complete Grid, if you need further assistance. 
Balaji Sekar. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon