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

Grid : Height to fit screenheight automatically

Thread ID:

Created:

Updated:

Platform:

Replies:

144871 May 27,2019 10:09 AM UTC Jan 3,2020 01:22 PM UTC Blazor 3
loading
Tags: Grid
Gert
Asked On May 27, 2019 10:09 AM UTC

Dear Syncfusion,

is it possible to set the height of the grid to 100% , so it fits the screen vertically ?

Regards,
Gert

Thavasianand Sankaranarayanan [Syncfusion]
Replied On May 28, 2019 11:19 AM UTC

Hi Gert, 
 
Thanks for contacting Syncfusion support. 
 
Query 1: is it possible to set the height of the grid to 100% , so it fits the screen vertically ? 
 
Yes, it is possible to set height of the grid to “100%”. We have prepared a sample where the grid fits the screen vertically. Please refer the below code snippet and sample link. 
 
[Index.razor] 
<EjsGrid id="Grid" DataSource="@gridData" Height="100%" >     
    <GridColumns> 
        <GridColumn Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" TextAlign="@TextAlign.Right" Width="120"></GridColumn> 
        .   .   .   . 
    </GridColumns> 
</EjsGrid> 
 
 
@functions { 
    public object gridData { get; set; } 
    protected override void OnInit() 
    { 
        gridData = OrdersDetails.GetAllRecords(); 
    } 
} 
 
 
 
Please get back to us for further assistance. 
 
Regards, 
Thavasianand S. 


Devware GmbH
Replied On January 2, 2020 07:01 PM UTC

Hello Thavasianand,

i have a same problem with the DataGrid Blazor Component. I want the Grid height justify with flexbox but the Grid component is over the browser screen with 100%. If i set the height to for example 300px it´s fine but not sizeable.

Have you a solution for DataGrid with display:flex?

Regards

Tibor


Vignesh Natarajan [Syncfusion]
Replied On January 3, 2020 01:22 PM UTC

Hi Devware,  

Greetings from Syncfusion support.  

Query: “Have you a solution for DataGrid with display:flex? 

We understand that you want to render the grid in the flexbox and want the Grid height to be adjusted within the box. If you want to the Grid to be adjusted inside the parent container, then we suggest you to define the height property of EjsGrid with 100% and also define specific height to parent container (flexbox). So that based on the flexbox height, Grid will be adjusted inside it.   

Refer the below code example.  

<div class="flex-container"> 
    <EjsGrid @ref="Grid" Height="100%" Width="100%" DataSource="@Orders" AllowPaging="true"> 
. . . . . . . . . . . ..  
    </EjsGrid> 
</div> 
<style> 
    .flex-container { 
        display: flex; 
        height: 500px; 
        width: 700px;         
    } 
</style> 
@code{ 

Refer our UG documentation for your reference 


Please get back to us with more details if you are facing any issues.  

Regards, 
Vignesh Natarajan.  
 


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