Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the color of the horizontal lines between rows in a asp.net gridview?

Using asp.net 3.5 Gridview control, visual studio 2008.

I have played with all the css border controls and can't set the color of the horizontal line between rows in an asp.net gridview. The color of the line seems to be defaulting to white. The only way those rows are visible are if the background color of the gridview is set to a dark color that contrasts with the white lines.

I have set Gridlines=Horizontal but cant find a way to set Gridlines color.

The gridview bordercolor attribute only affects the outermost border around the entire gridview.

I would rather not do this in javascript or jquery.

like image 689
Lill Lansey Avatar asked Feb 28 '23 07:02

Lill Lansey


1 Answers

Add a css class to the GridView CssClass="someClass", then do something like:

Update: Try something like this:

  <style>
        .someClass tr td
        {
            border-top: 1px solid red;
            border-bottom: 1px solid red;
        }
    </style>

 <asp:GridView ID="GridView1" runat="server" ... GridLines="Horizontal" CssClass="someClass">

And you will get red grid lines.

like image 133
RichardOD Avatar answered Mar 05 '23 16:03

RichardOD