M
Martin Brown
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?
<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?