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

Grid to resize to the screen/window size

Thread ID:

Created:

Updated:

Platform:

Replies:

127460 Nov 16,2016 02:55 PM Nov 21,2016 06:45 AM ASP.NET MVC 5
loading
Tags: Grid
Michael Lambert
Asked On November 16, 2016 02:55 PM

I want the grid to be sized so that the whole grid (including scrollbars) are display on the screen no matter what the screen/window size is and have it resize if the user resizes the window.  I understand that if the user has the window sized really small that most data will not be able to be displayed, but I don't want the user to have to use the windows scrollbars to get to the Grid scrollbars.

Mike

Mani Sankar Durai [Syncfusion]
Replied On November 17, 2016 06:35 AM

Hi Mike, 


Thanks for contacting Syncfusion support, 
 
We have analyzed your query and we can resize the grid based on window resizing by using Responsive feature of Grid. To enable responsiveness in Grid we need to set IsResponsive property as true and also it is necessary to mention MinWidth property in grid.  

Please refer the below code example. 

[Index.cshtml] 
@(Html.EJ().Grid<object>("Grid") 
             ... 
               .MinWidth(400) 
               .IsResponsive(true) 
              ... 
        
       .Columns(col => 
       { 
... 
            })) 
 

We have also prepared a sample that can be downloaded from the below link. 



Also please refer the documentation to know the necessity of MinWidth property and IsResponsive in grid. 





Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


Michael Lambert
Replied On November 17, 2016 01:00 PM

Hi Manisankar,
That works great for the width, but not the height.  The grid runs past the height of the window where you have a scrollbar for both window and then the grid.  I can set the Height in the ScrollSetting to accomplish what I need, but then it is not adaptive to the different size screens and windows.

Thanks,
Mike

Mani Sankar Durai [Syncfusion]
Replied On November 18, 2016 06:12 AM

Hi Mike, 

We have analyzed your query and we have achieved your requirement by giving Height as “100%” in ScrollSettings property of grid. To maintain the height responsive it is necessary to give Height as “100%” in ScrollSettings of grid. 

Please refer the below code example. 
[Index.cshtml] 
@(Html.EJ().Grid<object>("Grid") 
                 ...               
                .MinWidth(400) 
               .IsResponsive(true) 
               .AllowScrolling(true) 
              .ScrollSettings(scroll => scroll.Height("100%")) 
             .Columns(col => 
       { 
                 ... 
       }) 
  ) 

We have also prepared a sample that can be downloaded from the below link. 

Also please refer the documentation of about ScrollSettings property in grid. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai 


Michael Lambert
Replied On November 18, 2016 11:15 AM

Thanks, it worked....though a little embarrassed about not thinking 100% in scrollsetting ;)

Mani Sankar Durai [Syncfusion]
Replied On November 21, 2016 06:45 AM

Hi Mike, 

Thanks for your feedback. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai 


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.

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.

;