Set the Line Color Between Rows in an ASP.NET GridView

Have you wondered how to set the color between two rows in an ASP.NET GridView. The GridView control does not provide a direct attribute for setting a color to the lines between two rows. But here’s how to do it using CSS:

<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title>Change Color of Lines</title>    <style type="text/css">        .gridLines td        {            border-bottom: 1px solid Gray;        }    </style></head><body>    <form id="form1" runat="server">    <div>    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"        GridLines="Horizontal" CssClass="gridLines" DataKeyNames="ID" >        <Columns>               ...        </Columns>    </asp:GridView>    </div>    </form></body></html>

OUTPUT

image

Share:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Reddit
  • StumbleUpon
  • Twitthis
This entry was posted in ASP.Net, Syndicated. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree