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

Unwanted Horizontal Scrollbar in RadGrid

2 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dd
Top achievements
Rank 1
dd asked on 21 May 2010, 05:21 PM
Hi all,

I had a problem with my grid showing a horizontal scrollbar when it shouldn't.  I searched this forum for answers and found these three gems:
Remove the width on the MasterTableView.
Set the TableLayout to Fixed. 
Make sure the total of the column widths is less than the grid width.

That fixed it for IE8 - 8.0.7600, FF 3.6.3, and Chrome 4.1.249.1064.  But the problem still persists in IE7.  Can someone look at my grid declaration and see if there is something I can do to fix this?  Thanks!

 <telerik:RadGrid ID="grdFilters" runat="server" Width="614px" Height="150px" Skin="Web20"  
             AllowSorting="true" AutoGenerateColumns="false" AllowAutomaticDeletes="True"
             <MasterTableView RetrieveAllDataFields="false" ShowHeadersWhenNoRecords="true" 
             EnableNoRecordsTemplate="true" CommandItemDisplay="None" TableLayout="Fixed" > 
             <Columns> 
                 <telerik:GridBoundColumn DataField="FieldName" SortExpression="FieldName"  
                 HeaderText="Filter Type" HeaderStyle-Width="140px" > 
                 </telerik:GridBoundColumn> 
                 <telerik:GridBoundColumn DataField="FieldCompTypeText" SortExpression="FieldCompTypeText"  
                 HeaderText="Operand" HeaderStyle-Width="120px" > 
                 </telerik:GridBoundColumn> 
                 <telerik:GridBoundColumn DataField="FieldCompValueText" SortExpression="FieldCompValueText" 
                 HeaderStyle-Width="230px" HeaderText="Value" > 
                 </telerik:GridBoundColumn> 
                 <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton"
                 <HeaderStyle Width="70px" /> 
                 </telerik:GridButtonColumn> 
                 <telerik:GridBoundColumn DataField="FieldLineItem" Visible="false" HeaderStyle-Width="0px"
                 </telerik:GridBoundColumn> 
                 </Columns> 
                 <NoRecordsTemplate > 
                   <div style="font-style: italic; vertical-align: middle; text-align:center;"
                   <br /><br /> 
                   No filters to display 
                   </div> 
                   </NoRecordsTemplate> 
                  </MasterTableView> 
                    <ClientSettings Scrolling-AllowScroll="true" Scrolling-SaveScrollPosition="true" 
                    Scrolling-UseStaticHeaders="true" Selecting-AllowRowSelect="true" 
                    EnablePostBackOnRowClick="true"  > 
                    </ClientSettings> 
</telerik:RadGrid> 


2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 24 May 2010, 09:52 AM
Hi David,

IE6 and IE7 apply column widths differently, compared to other browsers - they also add the cell padding to the set width, so the columns actually become wider than specified. This is why a horizontal scrollbar occurs in IE7.

In your case you can leave one column with no width to avoid this issue.

Greetings,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
dd
Top achievements
Rank 1
answered on 24 May 2010, 04:25 PM
That works perfectly.  Thanks!
Tags
Grid
Asked by
dd
Top achievements
Rank 1
Answers by
Dimo
Telerik team
dd
Top achievements
Rank 1
Share this question
or