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

RadGrid Default Column Widths under IIS

5 Answers 229 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Drew Rhoades
Top achievements
Rank 2
Drew Rhoades asked on 13 May 2010, 06:44 PM

It appears that the initial column widths for the grid are not being defaulted consistently when deployed to the ASP.NET Development Server versus IIS.  Both IE and FF work correctly when run from the ASP.NET Dev Server, but once I publish the site and run it under IIS, the grid columns are not set to the default width in IE, but in FF they are still fine.

See the attached screen shots for the 4 combinations of IE vs. FF and ASP.NET vs. IIS.  It's the "Invoice Details" grid that is the problem in the IE/IIS combination.

This is how I'm setting up the grid in the markup:

<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">  
    <div style="vertical-align: top;height: 100%;">  
…snip…  
        <telerik:RadSplitter ID="ContentSplitter" Runat="server" Height="100%" Width="100%" 
            Orientation="Horizontal">  
…snip…  
            <telerik:RadPane ID="BodyPane" runat="server" Height="100%" Width="100%" Scrolling="Y" 
                OnClientResized="ClientResized">  
                <telerik:RadSplitter ID="AppSplitter" Runat="server" Height="100%">  
…snip…  
                    <telerik:RadPane ID="AppPane" runat="server" MinWidth="40" Scrolling="Y" Width="100%">  
…snip…  
                        <telerik:RadAjaxPanel ID="HeaderRadAjaxPanel" runat="server">  
…snip…  
                        <telerik:RadGrid ID="grdDetails" runat="server"   
                            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"   
                            AutoGenerateColumns="False" GridLines="Both" ShowFooter="true" 
                            Height="400" Width="100%" 
                            AllowAutomaticInserts="true" AllowAutomaticUpdates="true" 
                            AllowAutomaticDeletes="true" 
                            OnItemCreated="grdDetails_ItemCreated" 
                            OnNeedDataSource="grdDetails_NeedDataSource" 
                            OnItemDataBound="grdDetails_ItemDataBound">  
                            <MasterTableView TableLayout="Fixed" EditMode="InPlace" CommandItemDisplay="Top" /> 
                            <PagerStyle AlwaysVisible="true" Mode="NextPrev" /> 
                            <ClientSettings> 
                                <Scrolling AllowScroll="true"   
                                    EnableVirtualScrollPaging="true" SaveScrollPosition="true"   
                                    UseStaticHeaders="true" /> 
                                <Resizing AllowColumnResize="true"   
                                    ClipCellContentOnResize="true" EnableRealTimeResize="true"   
                                    ResizeGridOnColumnResize="true" /> 
                                <ClientEvents OnRowClick="grdDetails_RowClick" /> 
                            </ClientSettings> 
                        </telerik:RadGrid> 
                        </telerik:RadAjaxPanel> 
                    </telerik:RadPane>   
                </telerik:RadSplitter> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
…snip…  
    </div> 
</asp:Content> 
 

The columns are then created server-side in the code-behind, during the grid's PreRender event.  Every column has an explicit width set.

 

Does anyone have any ideas/suggestions on what the issue might be?  Everything I’ve tried has not forced the grid to behave.

 

My environment:
- Windows 7
- IIS 6.1
- VS 2008 SP1 (.NET 3.5 SP1), C#
- Telerik Q1 2010 Trial Version (2010.1.415.35)
- IE 8.0.7600.16385
- Firefox 3.6

 

Thanks in advance for any help.

Drew

5 Answers, 1 is accepted

Sort by
0
Drew Rhoades
Top achievements
Rank 2
answered on 13 May 2010, 07:49 PM
More information:

Wow.  This is bizarre.  It's only an issue when I use the "external" URL for my site (i.e. http://machinename/virtualroot).  If I use localhost, it works fine (i.e. http://localhost/virtualroot).

Uh...?
0
Accepted
Dimo
Telerik team
answered on 14 May 2010, 06:36 AM
Hi Drew,

IE6, IE7 and IE8 (only in compatibility mode) make columns wider than specified, because they add the cell paddings to the column width. Workarounding this issue is possible, but represents an overhead, so I suggest you to live with it. Otherwise you either have to use server-side browser detection and set different column widths for IE, or remove the RadGrid cell paddings from the skin and use only template columns with paddings defined for some inner element.

In your case IE8 runs in different mode when using machinename and localhost. You can enforce IE8 standards mode by using a meta tag in the <head> -

<meta http-equiv="X-UA-Compatible" content="IE=8" />

Regards,
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
Drew Rhoades
Top achievements
Rank 2
answered on 14 May 2010, 02:25 PM
Bingo!  In IE8's Compatibility View Settings, I had "Display intranet sites in Compatibility View" checked.  Unchecking that corrected the column widths.  Thanks for the help!
0
Keith Ralston
Top achievements
Rank 1
answered on 23 Feb 2011, 06:53 PM
What do I do if I am running in a mixed environment of IE7 & IE8? Remove RadGrid and use VS2010 DataGrid?

It appears that I am goping to have to roll back all my Web Controls to Q1n 2009 in which the grid works in all browsers. I am completely flumoxed that this is not the case for the 2010 editions. I will definitely be pushing for a different set of controls. The work around is unacceptable. Rendering should just work.
0
Pavlina
Telerik team
answered on 01 Mar 2011, 01:31 PM
Hello Keith,

In order to achieve exactly the same column widths in IE7 and IE8, you must remove all cell paddings from the RadGrid cells.

Best wishes,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Drew Rhoades
Top achievements
Rank 2
Answers by
Drew Rhoades
Top achievements
Rank 2
Dimo
Telerik team
Keith Ralston
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or