Alternating Row Style in a GridView


  • I am having trouble applying the alternate row style from my CSS to my gridview.  The GV seems to take on only the "RowStyle" attributes. I have even attempted to force the Alternate Row Style via the GridView Property window, AlternateRow Style.  I changed its color to a bright green which shows up in the CSS "example" window but not in the actual GridView.  Here is the CSS snippet:

      background-color: #EAEFF3;
      color: #000080;
      font-size: .8em;
      vertical-align: middle;
      text-align: center;
    • Moved by edhickeyModerator Friday, July 23, 2010 12:06 AM (From:.NET 3.0/3.5 Windows Workflow Foundation)
    • Moved by Harry Zhu Thursday, August 05, 2010 5:43 AM I'm moving the thread relating to (From:Visual C# General)
    Thursday, July 22, 2010 8:36 PM

All replies

  • Hi,


    The question relating to CSS is beyond the scope of this forum, I suggest you post to:


    You will get better support by the experts there.


    Best regards,

    Harry Zhu- MSFT

    MSDN Subscriber Support in Forum

    If you have any feedback of our support, please contact

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, July 23, 2010 3:20 AM
  • I use the GridView.AlternatingRowStyle property in my page's markup and it works just fine. There is not a problem with the GridView. Have you reviewed the example code for the AlternatingRowStyle property? Mine is quite simple but this works for me:

    <asp:GridView...><br/>  <AlternatingRowStyle CssClass="altRow" /><br/></asp:GridView>
      background-color: #E0E0E0;
    • Proposed as answer by DK. Da Saturday, July 24, 2010 3:15 PM
    Friday, July 23, 2010 9:49 PM
  • I think that some parameter is over riding my style.  I will continue looking and am confident that I will find it.
    Saturday, July 24, 2010 12:49 PM