Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DataGrid not displaying correctly in Opera 7.2

Reply
Thread Tools

DataGrid not displaying correctly in Opera 7.2

 
 
Martin Brown
Guest
Posts: n/a
 
      01-19-2004
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?


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      01-19-2004
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.a...1&PostID=89874

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


"Martin Brown" <(E-Mail Removed)> wrote in message
news:%23m%(E-Mail Removed)...
>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?
>
>



 
Reply With Quote
 
 
 
 
Martin Brown
Guest
Posts: n/a
 
      01-20-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.a...1&PostID=89874
>
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
>
> "Martin Brown" <(E-Mail Removed)> wrote in message
> news:%23m%(E-Mail Removed)...
> >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?
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie: page don't dispay correctly in Opera Jeff HTML 3 11-25-2005 10:19 AM
opera doesn't display correctly Alexandre Jaquet HTML 1 09-08-2005 10:26 AM
Re: HELP!!! ASP.NET pages not displaying correctly Raterus ASP .Net 1 06-05-2004 05:20 PM
intranet site not displaying correctly on subnet Jim PKP Computer Support 0 01-15-2004 09:48 PM
Java Servlet not displaying PDF/ZIP files correctly in IE Paul Jacobs Java 3 08-25-2003 07:12 PM



Advertisments