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

Horizontal scrollbar

3 Answers 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Walter
Top achievements
Rank 1
Walter asked on 01 Jun 2008, 01:35 PM

Hi guys,

I'm using a grid control with scrolling en paging enabled. Everything works fine except that the grid displays a horizontal scrollbar which is not necessary. Can you tell me how to get rid of the horizontal scrollbar?

I'm using IE 6.0.

<telerik:RadGrid ID="itemGrid" runat="server" Width="100%" Height="100%" 
    GridLines="None" AllowSorting="True" AllowPaging="True" PageSize="25" AllowMultiRowSelection="True" 
    OnNeedDataSource="itemGrid_NeedDataSource" OnSelectedIndexChanged="itemGrid_SelectedIndexChanged">  
    <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="Change page: {4} | Displaying page {0} of {1}, items {2} to {3} of {5}" /> 
    <MasterTableView AutoGenerateColumns="False" TableLayout="Fixed" ClientDataKeyNames="Id,Iteration" Width="100%">  
        <Columns> 
            <telerik:GridBoundColumn UniqueName="Id" DataField="Id" Display="False" /> 
            <telerik:GridBoundColumn UniqueName="Status" DataField="Status" Display="False" /> 
            <telerik:GridBoundColumn UniqueName="LockUserId" DataField="LockUserId" Display="False" /> 
            <bisolid:ItemTypeGridColumn HeaderStyle-Width="20" ItemStyle-Width="20" /> 
            <telerik:GridBoundColumn Headertext="Name" UniqueName="Name" DataField="Name" /> 
            <telerik:GridBoundColumn Headertext="Iteration" UniqueName="Iteration" HeaderStyle-Width="70" ItemStyle-Width="70" DataField="Iteration" /> 
            <telerik:GridBoundColumn Headertext="Version" UniqueName="Version" HeaderStyle-Width="70" ItemStyle-Width="70" DataField="Version" /> 
            <telerik:GridBoundColumn Headertext="Status" UniqueName="StatusDescription" HeaderStyle-Width="70" ItemStyle-Width="70" DataField="StatusDescription" /> 
            <telerik:GridBoundColumn Headertext="Date-Time" UniqueName="Timestamp" HeaderStyle-Width="100" ItemStyle-Width="100" DataField="Timestamp" DataFormatString="{0:g}" /> 
            <telerik:GridBoundColumn Headertext="User" UniqueName="Username" HeaderStyle-Width="100" ItemStyle-Width="100" DataField="Username" /> 
        </Columns> 
    </MasterTableView> 
    <ClientSettings EnablePostBackOnRowClick="true" ClientEvents-OnRowSelected="itemGrid_onRowSelected">  
        <Selecting AllowRowSelect="True" /> 
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" /> 
        <ClientEvents OnRowContextMenu="itemGrid_onRowContextMenu" /> 
    </ClientSettings> 
</telerik:RadGrid> 

Thanks,

Walter

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Jun 2008, 05:13 AM
Hi Walter,

 To restrict the horizontal bar from being rendered, verify that:
  • the width for the MasterTableView is set to 99% if auto-generated columns are used
  • the total width of the declaratively set columns is smaller than the width of the grid itself

You can also refer the following demo link.
Basic scrolling

Thanks
Princy.

0
Walter
Top achievements
Rank 1
answered on 03 Jun 2008, 05:49 AM
Hi Princy,

All columns except the name column has a fixed width. I want the name column to fill up the available space. (grid control width is set to 100%)

De horizontal scrollbar only scrolls a few pixels.
Setting the MasterTableView width to 98% works but looks awfull. Another problem is that the columns are not aligned with the headers.

Maybe you can take a look at this screenshot and see what I mean: click

Walter
0
Dimo
Telerik team
answered on 03 Jun 2008, 06:54 AM
Hello Walter,

The horizontal scrollbar appears in Internet Explorer due to its behavior related to scrollbars. Please remove the Width="100%" setting from the MasterTableView. If the data in your grid cells is not too large, no horizontal scrollbar will appear.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Walter
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Walter
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or