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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic grid height

Thread ID:

Created:

Updated:

Platform:

Replies:

147568 Sep 17,2019 01:13 AM UTC Sep 17,2019 01:41 PM UTC JavaScript - EJ 2 1
loading
Tags: Grid
Travis
Asked On September 17, 2019 01:13 AM UTC

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,
      selectionSettings:
      {
        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
    }
  );

Thavasianand Sankaranarayanan [Syncfusion]
Replied On 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. 

Regards, 
Thavasianand S. 


CONFIRMATION

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