Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:26:57+00:00 2026-05-10T20:26:57+00:00

I created a GridView in an ASP.NET application and used the Auto Format tool

  • 0

I created a GridView in an ASP.NET application and used the Auto Format tool to apply an attractive style. Now I’m moving the style markup to the CSS sheet and I’m having a weird problem where the text in the header row isn’t the correct color (it should be white but it shows up a bright blue). This problem only shows up when I turn sorting on.

Everything else works fine. For example, I can change the header background to red and it turns red and the rest of the grid styles are applied appropriately.

Anybody have any clues about what the deal is? I’ve included code snippets below. I’m also fairly new to CSS. If anyone has any tips to make my CSS markup better in some way, let me know.

Thanks!

Here is the ASP.NET code. I can add ForeColor=’White’ to the HeaderStyle and everything works normally.

<asp:GridView ID='GridView1' runat='server' CssClass='grid' AutoGenerateColumns='False' DataKeyNames='ID' DataSourceID='SqlDataSource1'  EmptyDataText='There are no data records to display.' AllowSorting='True'  CellPadding='4' GridLines='Both'> <FooterStyle CssClass='grid-footer' /> <RowStyle CssClass='grid-row' />     <Columns>         <asp:BoundField DataField='Kingdom' HeaderText='Kingdom'              SortExpression='Kingdom' />         <asp:BoundField DataField='Phylum' HeaderText='Phylum'              SortExpression='Phylum' />         <asp:BoundField DataField='GenusSpeciesStrain' HeaderText='Genus species (strain)'              SortExpression='GenusSpeciesStrain' />         <asp:BoundField DataField='Family' HeaderText='Family'              SortExpression='Family' />         <asp:BoundField DataField='Subfamily' HeaderText='Subfamily'              SortExpression='Subfamily' />         <asp:BoundField DataField='ElectronInput' HeaderText='Electron Input'              SortExpression='ElectronInput' />         <asp:BoundField DataField='OperonLayout' HeaderText='Operon Layout'              SortExpression='OperonLayout' />     </Columns>     <PagerStyle CssClass='grid-pager' />     <SelectedRowStyle CssClass='grid-selected-row' />     <HeaderStyle CssClass='grid-header' />     <EditRowStyle CssClass='grid-row-edit' />     <AlternatingRowStyle CssClass='grid-row-alternating' /> 

And this is the content from style sheet I’m using:

body { }  .grid {     color: #333333; }  .grid-row {     background-color: #EFF3FB; }  .grid-row-alternating {     background-color: White; }  .grid-selected-row {     color: #333333;     background-color: #D1DDF1;     font-weight: bold; }  .grid-header, .grid-footer {     color: White;     background-color: #507CD1;     font-weight: bold; }  .grid-pager {     color: White;     background-color: #2461BF;     text-align: center; }  .grid-row-edit {     background-color: #2461BF; } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:26:57+00:00Added an answer on May 10, 2026 at 8:26 pm

    I’m guessing the bright blue is very similar to the color of a hyperlink. Making the gridview sortable means you’ll have an a tag inside your header instead of just plain text.

    This should sort it:

    .grid-header a { color: White; background-color: #507CD1; font-weight: bold; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Ok, folks, I talked to a dozen different people on… May 11, 2026 at 3:16 pm
  • added an answer DDD s new enough (at least in some senses) that… May 11, 2026 at 3:16 pm
  • added an answer May want to try installing Windows Media Services on your… May 11, 2026 at 3:16 pm

Related Questions

In my .NET application I need to add a checkbox to each row in
I have a web application that I am working on(ASP.NET 2.0 C#). In it
Looks like my only option is to create a mutatant child of the tree
I have a dropdown list that stores name/value pairs. The dropdown appears in each

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.