gridview stylesheet code?

Following is some of the stylesheet code supplied by our graphic designer for a table on my web form.  She was working from a screenshot, but what I was really using is a gridview.

How can I achieve the same visual effects on a gridview?  Ideally, I should be able to add the code you give me into her style sheet and then just set my gridview CSSClass to the new type.

/* --[ TABLE/GRID ]----------------------------------------------------- */
#main #tblData {
	width: 100%; }

#main #tblData td {
	vertical-align: top; 
	padding: 5px;
	border: 1px solid #d1d7e2; }

#main #tblData td.edit {
	font-size: 10px;
	width: 20px;
	background-color: #d1d7e2; }

#main #tblData tr.altrow {
		background-color: #e6edfc; }

#main #tblData tr.hover td {
	background-color: #d1d7e2;
	cursor: pointer; }
#main #tblData thead tr td {
	border: 0px;
	font-weight: bold;
	color: #666666;
	background-color: #ffffff;

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can add all these CSS values to the Skin file in the project. A simple example of my is below. Don't forget to reference the skin file in your web.config pages section.

<asp:GridView runat="server" BackColor="White" >
	<AlternatingRowStyle BackColor="#D1D1D1" />
	<HeaderStyle BackColor="Black" ForeColor="White" Font-Bold="true" />

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
codefingerAuthor Commented:
Interesting.  I have not used skins before....first time hearing of them.

What would the web config entry look like?

<pages theme="MainStyle"/> with "MainStyle" being the name of your skin file.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

codefingerAuthor Commented:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Content ('<HeaderStyle BackColor="Black" ForeColor="White" Font-Bold="true"') does not match any properties within a 'System.Web.UI.WebControls.GridView', make sure it is well-formed.

Source Error:

Line 16: <asp:GridView runat="server" SkinId="gridViewSkin" BackColor="Red" >
Line 17:    <AlternatingRowStyle BackColor="#D1D1D1" />
Line 18:       <HeaderStyle BackColor="Black" ForeColor="White" Font-Bold="true"
Line 19: </asp:GridView>


Source File: /MyChartInternal/App_Themes/VSSkin/    Line: 18

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
You're missing the " />" at the end of the line.
codefingerAuthor Commented:
DOH!  Having a Homer moment....sorry....
codefingerAuthor Commented:
Works beautifully and taught me something I did not know before...nice...

strickdd....having a problem with a radiobuttonlist I am sure you can help me with, but I will shortly be asking about that in a related question...please keep an eye out for it.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.