By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Grid headerStyle not overriding Css page

P: n/a
I have a DataGrid where I want the text in the cells to be black. But I
want the header to have a black background and white text.

The problem is the settings in the DataGrid are not overriding the Css files
(which is in a User Control).

The Css file (in the .aspx file) has the following lines:

td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
text-decoration: none;
}

This should make all my table cells black, which it does.

I then have the following DataGrid setting for the HeaderStyle:

<headerstyle CssClass="jay" BackColor="#000000" ForeColor="#FFFFFF"
Font-Bold="true" />

The style Jay is:

..jay { color:#FFFFFF; font-weight:bold}

I have this in my .ascx file after the style sheet. And the HeaderStyle is
using "jay" and has the ForeColor="#FFFFFF".

But the color of the background is correct, but the text is black (the "td"
definition).

So why isn't the "td" style overroad?

Thanks,

Tom
Jul 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Also, when I do a view source, I get the following for the datagrids table
and tr tags:

<table cellspacing="0" rules="all" bordercolor="#999999" border="1"
id="_ctl2_DataGrid2"
style="border-color:#999999;border-collapse:collapse;margin: 5px 5px 5px
5px; padding-left:3px;border-collapse:separate; width:780px">
<tr class="jay"
style="color:White;background-color:Black;font-weight:bold;">
<td>Job Title</td><td>Location</td><td>Type</td><td>Wages</td><td>Experience
Level</td><td>Posted</td>

As you can see the <trtag has the attributes, how do I get the text
correct?

Thanks,

Tom

"tshad" <ts**********@ftsolutions.comwrote in message
news:u1**************@TK2MSFTNGP02.phx.gbl...
>I have a DataGrid where I want the text in the cells to be black. But I
want the header to have a black background and white text.

The problem is the settings in the DataGrid are not overriding the Css
files (which is in a User Control).

The Css file (in the .aspx file) has the following lines:

td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
text-decoration: none;
}

This should make all my table cells black, which it does.

I then have the following DataGrid setting for the HeaderStyle:

<headerstyle CssClass="jay" BackColor="#000000" ForeColor="#FFFFFF"
Font-Bold="true" />

The style Jay is:

.jay { color:#FFFFFF; font-weight:bold}

I have this in my .ascx file after the style sheet. And the HeaderStyle
is using "jay" and has the ForeColor="#FFFFFF".

But the color of the background is correct, but the text is black (the
"td" definition).

So why isn't the "td" style overroad?

Thanks,

Tom

Jul 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.