Grid Height in Partial View

Hi,

as the Grid is missing a height setting I tried to set it with .CssClass.
My Grid is within a partial view and allows paging.
The problem is, that the grid height is higher than the defined height in the css class after rendering.
I expect that the Grid page height can be set in some way, even if it is rendered in a partial view - how can I do that?

Cheers,
Jonas

3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team February 7, 2018 04:34 PM UTC

Hi Jonas, 

Query # :-I expect that the Grid page height can be set in some way, even if it is rendered in a partial view 

Thanks for contacting Syncfusion Grid. 

To achieve your requirement we suggest you to use Responsive Feature of the Grid. Syncfusion Grid has the default support for Responsive based on client browser’s width and height . To enable Responsive behavior you have to set “IsResponsive” property of the Grid as true. And also you have to set “MinWidth” property for Grid. Min Width is used to maintain minimum width for the Grid. This will resolve your problem. Also, to make the Grid height to be responsive, set Height of the ScrollSettings property to be 100%. 
 
Please refer to the code example:- 

@(Html.EJ().Grid<object>("FlatGrid") 
            .Datasource((IEnumerable<object>)ViewBag.dataSource) 
             .AllowPaging() 
             .AllowScrolling() 
             .ScrollSettings(col => { col.Width(500).Height((50)); }) 
             .IsResponsive(true) 
             .EnableResponsiveRow(true) 
             .MinWidth(990) 
             .Columns(col => 
             { 
 
               col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).ValidationRules(v => v.AddRule("required",true).AddRule("number", true)).Width(100).Add(); 
             
        
              }) 
         
       ) 
 

Please refer to the document link:- 

 
Please get back to if you need any further assistance. 

Regards, 

Farveen sulthana  



JZ Jonas Züger February 8, 2018 08:38 PM UTC

It worked - thanks a lot!

Cheers, Jonas


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team February 9, 2018 04:23 AM UTC

Hi Jonas, 

Thanks for your update. We are glad to know that your reported problem has been resolved. Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 


Loader.
Up arrow icon