This is a migrated thread and some comments may be shown as answers.

Unable to successfully set grid height

2 Answers 255 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hugo
Top achievements
Rank 1
Hugo asked on 26 Jan 2017, 10:45 PM

Anybody else having trouble setting the height of a grid in asp.net core?

@(Html.Kendo().Grid<Basic_Core.Models.Authors>()
    .Name("grid")
    .HtmlAttributes(new { style = "height:850px;" })

etc......

No matter what height I set it always renders with 400px. This even happens with the demo grid from Telerik.

The exact same code works just fine  with MVC5

@(Html.Kendo().Grid<Basic_MVC.Models.Authors>()
    .Name("grid")
    .HtmlAttributes(new { style = "height:850px;" })

etc.....

 

Would be really grateful for an insightful answer.

 

 

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 31 Jan 2017, 03:44 PM
Hello Hugo,

Would you check if you have Scrollable() set for the Grid? When scrollable is enabled the Grid will have a default height of 400 pixels.

If you would like to keep the scrolling feature and set the height of the grid you should set the height of the scrollable container.


.Scrollable(s=>s.Height(850))



Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Hugo
Top achievements
Rank 1
answered on 31 Jan 2017, 09:52 PM

Hi Viktor,

That worked like a charm!

 

Thank you!

 

Hugo

Tags
Grid
Asked by
Hugo
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Hugo
Top achievements
Rank 1
Share this question
or