DataGrid not displaying correctly in Opera 7.2

Discussion in 'ASP .Net Datagrid Control' started by Martin Brown, Jan 19, 2004.

  1. Martin Brown

    Martin Brown Guest

    I have a datagrid defined as follows:

    <asp:datagrid id="dgSubmissionHistory" ShowHeader="True" ShowFooter="True"
    BorderStyle="None"
    BorderWidth="1px" runat="server" BorderColor="#CCCCCC"
    BackColor="White" CellPadding="3" AutoGenerateColumns="False" Width="100%"
    AllowSorting="True">
    <SelectedItemStyle Font-Bold="True"
    BackColor="#D8DCFE"></SelectedItemStyle>
    <ItemStyle ForeColor="#000066" BackColor="White"></ItemStyle>
    <HeaderStyle Font-Bold="True" ForeColor="White"
    BackColor="#0000CC"></HeaderStyle>
    <FooterStyle ForeColor="#000066" BackColor="#d8dcfe"></FooterStyle>
    <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    <Columns>
    <asp:BoundColumn Visible="False" DataField="SubmissionID"
    HeaderText="SubmissionHistoryID"></asp:BoundColumn>
    <asp:ButtonColumn DataTextField="CurrentStatus"
    SortExpression="CurrentStatus" HeaderText="Status"></asp:ButtonColumn>
    <asp:ButtonColumn DataTextField="ApplicationType"
    SortExpression="ApplicationType" HeaderText="Application
    type"></asp:ButtonColumn>
    <asp:ButtonColumn DataTextField="SubmittedDate"
    SortExpression="SubmittedDate" HeaderText="Received"
    DataTextFormatString=""></asp:ButtonColumn>
    <asp:ButtonColumn DataTextField="ModifiedDate"
    SortExpression="ModifiedDate" HeaderText="Modified"></asp:ButtonColumn>
    </Columns>
    </asp:datagrid>

    When I display this in IE all looks fine the header is blue and the item
    rows are white and gray. When I display it in Opera though, all the cells
    have the same background color as the rest of the page. It seems that when
    the DataGrid renders for IE it uses the STYLE attribute, however when it
    renders it for Opera it uses the BGCOLOR attribute. The bgcolor attribute
    however gets overridden by an entry in the sites css file. Seeing that Opera
    supports the STYLE attribute does anyone know how to force the DataGrid to
    use it?
     
    Martin Brown, Jan 19, 2004
    #1
    1. Advertising

  2. Martin Brown

    Teemu Keiski Guest

    Hi,

    by default ASP.NET considers other browsers than IE as downlevel which means
    they HTML 3.2 and so on. Fortunately this behavior is customizable. I have
    explained the action to achieve this at ASP.NET Forums on following thread:
    http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=89874

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist


    "Martin Brown" <> wrote in message
    news:%23m%...
    >I have a datagrid defined as follows:
    >
    > <asp:datagrid id="dgSubmissionHistory" ShowHeader="True" ShowFooter="True"
    > BorderStyle="None"
    > BorderWidth="1px" runat="server" BorderColor="#CCCCCC"
    > BackColor="White" CellPadding="3" AutoGenerateColumns="False" Width="100%"
    > AllowSorting="True">
    > <SelectedItemStyle Font-Bold="True"
    > BackColor="#D8DCFE"></SelectedItemStyle>
    > <ItemStyle ForeColor="#000066" BackColor="White"></ItemStyle>
    > <HeaderStyle Font-Bold="True" ForeColor="White"
    > BackColor="#0000CC"></HeaderStyle>
    > <FooterStyle ForeColor="#000066" BackColor="#d8dcfe"></FooterStyle>
    > <AlternatingItemStyle BackColor="Gainsboro"></AlternatingItemStyle>
    > <Columns>
    > <asp:BoundColumn Visible="False" DataField="SubmissionID"
    > HeaderText="SubmissionHistoryID"></asp:BoundColumn>
    > <asp:ButtonColumn DataTextField="CurrentStatus"
    > SortExpression="CurrentStatus" HeaderText="Status"></asp:ButtonColumn>
    > <asp:ButtonColumn DataTextField="ApplicationType"
    > SortExpression="ApplicationType" HeaderText="Application
    > type"></asp:ButtonColumn>
    > <asp:ButtonColumn DataTextField="SubmittedDate"
    > SortExpression="SubmittedDate" HeaderText="Received"
    > DataTextFormatString=""></asp:ButtonColumn>
    > <asp:ButtonColumn DataTextField="ModifiedDate"
    > SortExpression="ModifiedDate" HeaderText="Modified"></asp:ButtonColumn>
    > </Columns>
    > </asp:datagrid>
    >
    > When I display this in IE all looks fine the header is blue and the item
    > rows are white and gray. When I display it in Opera though, all the cells
    > have the same background color as the rest of the page. It seems that when
    > the DataGrid renders for IE it uses the STYLE attribute, however when it
    > renders it for Opera it uses the BGCOLOR attribute. The bgcolor attribute
    > however gets overridden by an entry in the sites css file. Seeing that
    > Opera
    > supports the STYLE attribute does anyone know how to force the DataGrid to
    > use it?
    >
    >
     
    Teemu Keiski, Jan 19, 2004
    #2
    1. Advertising

  3. Martin Brown

    Martin Brown Guest

    Thanks Teemu,

    By adding the following to my web.config file, the problem is solved.

    <configuration>
    <!-- bits ommitted for clarity -->
    <system.web>
    <!-- bits ommitted for clarity -->

    <browserCaps>
    <filter>
    <case match="Opera[
    /](?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))">
    <filter match="[5-9]" with="${major}">
    tagwriter=System.Web.UI.HtmlTextWriter
    </filter>
    </case>
    </filter>
    </browserCaps>

    </system.web>
    </configuration>

    "Teemu Keiski" <> wrote in message
    news:...
    > Hi,
    >
    > by default ASP.NET considers other browsers than IE as downlevel which

    means
    > they HTML 3.2 and so on. Fortunately this behavior is customizable. I have
    > explained the action to achieve this at ASP.NET Forums on following

    thread:
    > http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=89874
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsiders member
    > ASP.NET Forum Moderator, AspAlliance Columnist
    >
    >
    > "Martin Brown" <> wrote in message
    > news:%23m%...
    > >I have a datagrid defined as follows:
    > >
    > > <asp:datagrid id="dgSubmissionHistory" ShowHeader="True"

    ShowFooter="True"
    > > BorderStyle="None"
    > > BorderWidth="1px" runat="server" BorderColor="#CCCCCC"
    > > BackColor="White" CellPadding="3" AutoGenerateColumns="False"

    Width="100%"
    > > AllowSorting="True">
    > > <SelectedItemStyle Font-Bold="True"
    > > BackColor="#D8DCFE"></SelectedItemStyle>
    > > <ItemStyle ForeColor="#000066" BackColor="White"></ItemStyle>
    > > <HeaderStyle Font-Bold="True" ForeColor="White"
    > > BackColor="#0000CC"></HeaderStyle>
    > > <FooterStyle ForeColor="#000066"

    BackColor="#d8dcfe"></FooterStyle>
    > > <AlternatingItemStyle

    BackColor="Gainsboro"></AlternatingItemStyle>
    > > <Columns>
    > > <asp:BoundColumn Visible="False" DataField="SubmissionID"
    > > HeaderText="SubmissionHistoryID"></asp:BoundColumn>
    > > <asp:ButtonColumn DataTextField="CurrentStatus"
    > > SortExpression="CurrentStatus" HeaderText="Status"></asp:ButtonColumn>
    > > <asp:ButtonColumn DataTextField="ApplicationType"
    > > SortExpression="ApplicationType" HeaderText="Application
    > > type"></asp:ButtonColumn>
    > > <asp:ButtonColumn DataTextField="SubmittedDate"
    > > SortExpression="SubmittedDate" HeaderText="Received"
    > > DataTextFormatString=""></asp:ButtonColumn>
    > > <asp:ButtonColumn DataTextField="ModifiedDate"
    > > SortExpression="ModifiedDate" HeaderText="Modified"></asp:ButtonColumn>
    > > </Columns>
    > > </asp:datagrid>
    > >
    > > When I display this in IE all looks fine the header is blue and the item
    > > rows are white and gray. When I display it in Opera though, all the

    cells
    > > have the same background color as the rest of the page. It seems that

    when
    > > the DataGrid renders for IE it uses the STYLE attribute, however when it
    > > renders it for Opera it uses the BGCOLOR attribute. The bgcolor

    attribute
    > > however gets overridden by an entry in the sites css file. Seeing that
    > > Opera
    > > supports the STYLE attribute does anyone know how to force the DataGrid

    to
    > > use it?
    > >
    > >

    >
    >
     
    Martin Brown, Jan 20, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raterus
    Replies:
    1
    Views:
    599
    Guest
    Jun 5, 2004
  2. Paul Jacobs
    Replies:
    3
    Views:
    4,617
    Neomorph
    Aug 25, 2003
  3. Alexandre Jaquet

    opera doesn't display correctly

    Alexandre Jaquet, Sep 8, 2005, in forum: HTML
    Replies:
    1
    Views:
    455
    Spartanicus
    Sep 8, 2005
  4. Jeff
    Replies:
    3
    Views:
    437
    .:|:.
    Nov 25, 2005
  5. Bob
    Replies:
    24
    Views:
    1,567
Loading...

Share This Page