Grid headerStyle not overriding Css page

T

tshad

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
 
T

tshad

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 <tr> tag has the attributes, how do I get the text
correct?

Thanks,

Tom
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top