473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Grid headerStyle not overriding Css page

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
1 2889
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rmorvay | last post by:
I am trying to dynamically build a dropdownlist and bind it to a cell in a grid. I tried to utilize the following code but I am stuck at the point where I bind the dropdownlist to the grid cell. ...
3
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of...
13
by: John M | last post by:
Hello, In Visual studio .NET 2003, On datagrid object : How can I link the button element : edit, to do a some client events (such as message box, and do another event just after that to the...
7
by: androoo | last post by:
Hi I am learing how to use the grid in asp.net. Im trying to replace the button columns with nice friendly images. So : <asp:ButtonColumn Text="Delete"...
2
by: androoo | last post by:
Hi I am learing how to use the grid in asp.net. Im trying to replace the button columns with nice friendly images. So : <asp:ButtonColumn Text="Delete"...
4
by: Girish | last post by:
Im trying to create a grid within a grid programmatically. Ive been successful in doing this but I need the embedded grid to fire its ItemDataBound event so I can handle it. The event does not seem...
1
by: Joe Dunleavy | last post by:
Hi Guys, Hopefully some one will have come across this issue already. I have a DataGrid inside a Div where a scroll bar displays once a certain height is meet --> <div id="dvSales"...
10
by: John Wilson | last post by:
My app produces some long datatables to display in a grid. So I put them in a div so users can scroll. But the grid headers scroll out of view. I would like to stop them doing this. Can I fix them...
0
by: weiwei | last post by:
Hi; I am having trouble to get variable from grid view. here is my scenario. I want to delete a row in database from web page, in additon, I also want to delete that user's directory in c:drive. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.