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

RadGrid sizing in some browsers

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Russo
Top achievements
Rank 1
Paul Russo asked on 15 Feb 2011, 10:46 PM
When rendering a radgrid using scrolling  the grid is properly rendered with the scrolling bar, but padding is added to the right of the grid, as if scrolling was not implemented.

For instance, say my RadGrid without scrolling is 1000px.  If I size it to 600px and add scrolling.  The Rad grid is rendered as 600px wide, with the scrolling bar.  However to the right of the RadGrid it is still padded with the remaining 400px.  I can't figure out why this padding is added.  It's as if the scroll was implemented for display, but the RadGrid still occupies it's original width space.


Here is a sample of the code:


<telerik:RadGrid ID="RadGridPerformance" runat="server" AutoGenerateColumns="False" Width="600px" Height="175px" >
 <MasterTableView TableLayout="Fixed">
         <Columns>
                 <telerik:GridBoundColumn HeaderText="" DataField="Year"  />
                        <telerik:GridBoundColumn HeaderText="YTD" DataField="Ytd"  />
                        <telerik:GridBoundColumn HeaderText="Jan" DataField="Jan"  />
                        <telerik:GridBoundColumn HeaderText="Feb" DataField="Feb"   />
                        <telerik:GridBoundColumn HeaderText="Mar" DataField="Mar"   />
                        <telerik:GridBoundColumn HeaderText="Apr" DataField="Apr"   />
                        <telerik:GridBoundColumn HeaderText="May" DataField="May"   />
                        <telerik:GridBoundColumn HeaderText="Jun" DataField="Jun"   />
                        <telerik:GridBoundColumn HeaderText="Jul" DataField="Jul"   />
                        <telerik:GridBoundColumn HeaderText="Aug" DataField="Aug"   />
                        <telerik:GridBoundColumn HeaderText="Sep" DataField="Sep"   />
                        <telerik:GridBoundColumn HeaderText="Oct" DataField="Oct"  />
                        <telerik:GridBoundColumn HeaderText="Nov" DataField="Nov"  />
                        <telerik:GridBoundColumn HeaderText="Dec" DataField="Dec"  />
             </Columns>
      </MasterTableView>
        <HeaderStyle Width="60px" />
        <ClientSettings>
         <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" FrozenColumnsCount="1">
                </Scrolling>
      </ClientSettings>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 18 Feb 2011, 02:56 PM
Hello Paul Russo,

Note that when scrolling is enabled and UseStaticHeaders is True, the grid columns should declare HeaderStyle.Width. Therefore, to resolve the problem you should set column widths using HeaderStyle-Width property. You can examine the project attached to this message which demonstrates how to achieve your goal.

Greetings,
Pavlina
the Telerik team
Tags
Grid
Asked by
Paul Russo
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or