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

Scroll bar without Paging

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
GrayMeth
Top achievements
Rank 1
GrayMeth asked on 18 Sep 2014, 03:55 PM
I want to specify max height of the grid content.
I have tried to keep .Scrollbar() and in this by default it is taking 200px as the height. In this case i am getting the scrollbar if the content size is more then 200px but if it is less then 200px then i am getting an empty space till 200px height.

I have tried to keep .Scrollbar(s =>s.height("auto")). In this case i am not getting the scrollbar.

I have even tried to override k-grid-content class by specifying the max-height something like this
#gvCommList .k-grid-content {
        max-height:300px !important;
    }
in this case in IE8 the browser is getting crashed.

I want the height to be adjusted automatically based on the content size and should work in all the browsers.

How to do that?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 Sep 2014, 11:58 AM
Hello Akhil,

Your approach is correct (!important is not needed), however, there is no way to avoid the IE8 bug, apart from removing the problematic style, which causes the browser to crash.

http://stackoverflow.com/questions/7707/ie8-overflowauto-with-max-height


<style>
 
#grid .k-grid-content
{
    max-height: 300px;
}
 
.k-ie8 #grid .k-grid-content
{
    max-height: none;
}
 
</style>
 
@(Html.Kendo().Grid()   
    .Name("grid")
    .Scrollable(s => s.Height("auto"))
)


Regards,
Dimo
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
GrayMeth
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or