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

Vertical scrollbar not showing

2 Answers 1010 Views
Grid
This is a migrated thread and some comments may be shown as answers.
randall
Top achievements
Rank 1
randall asked on 28 Jan 2015, 10:15 PM
Hi,
i have a rad grid that for some reason will not show the scrollbars when the grid is full size.
The grid is nested inside a pageview which is 500px wide.
the grid itself is 493px wide.

now if i reduce the grid size down to 350px then the scrollbar shows up. however anything over that it disappears.
I've tried changing all the values of the pageview size and grid size etc but nothing seem to work.

Anyone know how to fix this?

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 02 Feb 2015, 12:16 PM
Hi Randall,

By default, the ScrollHeight property of the grid is set to 300px, so if the height of the content is less than 300px, the vertical scroll bar will not be displayed. Nevertheless, if you need to display the vertical scroll bar despite the content of the grid, you could use the following CSS to override the overflow style of the data container:
<style type="text/css">
    div.RadGrid .rgDataDiv {
        overflow-y: scroll!important;
    }
</style>

And here are the RadGrid settings:
<telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource">
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    </ClientSettings>
</telerik:RadGrid>

Hope this helps.


Regards,
Konstantin Dikov
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.

 
0
Tuhiram
Top achievements
Rank 1
answered on 16 Feb 2019, 07:24 AM
 <script type="text/javascript">
         function GridCreated(sender, args) {
             var scrollArea = sender.GridDataDiv;
             var dataHeight = sender.get_masterTableView().get_element().clientHeight;
             if (dataHeight <= 300) {
                 scrollArea.style.height = dataHeight + "px";
             }
             if (dataHeight > 300) {
                 scrollArea.style.height = 310+ "px";
             }
         }
</script>
Tags
Grid
Asked by
randall
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Tuhiram
Top achievements
Rank 1
Share this question
or