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

Dynamic grid height

Hi Team:

I need some assistance in setting the grid height.  Below is what I am doing to create the grid with a height of 500px.  When the grid is created, its has not yet been rendered to my html page.  What I would like to have is a grid where the height can be more dynamic.  Can the height be calculated using the CSS Calc() function?  Can the height be calculated using CSS flex?  If so, please provide an example. I have not been able to get either to work.

this.SfGrid = new ej.grids.Grid // Syncfusion Grid
      columns: this.Columns,
      dataSource: this.Rows,
      allowPaging: false, // scrollbar instead of pages
      allowSelection: true,
        mode: 'Row',
        type: (this.SelectMultiple) ? 'Multiple' : 'Single',
      height: '500px',
      rowSelected: function (_args)
        if (this.IsInhibitSubmit) // no submit during SetValue invocation
          this.IsInhibitSubmit = false;
        else if (this.Submit == 2) // OnSelected
          this.Value = _args.data.Key;
          this.IsModified = true;
          this.Form.Submit (this);
      }.bind (this), // bind control scope

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team September 17, 2019 01:41 PM UTC

Hi Travis, 

Greetings from Syncfusion support. 

Based on your query we suspect that you wants to show the Grid inside the parent container with dynamically changing the height. So, we suggest you to set some particular height to it’s parent container and set Grid height as 100%. So, it will show the Grid inside the parent’s container, which have the dynamic height. 

If we misunderstood your query then please get bac to us. 

Thavasianand S. 

Live Chat Icon For mobile
Up arrow icon