2

I have gridlines set to true on a gridview, i want the lines to be grey. By default, the lines in IE appear grey, due to my stylesheets; but in Firefox, there is a dark line separating the header columns.

I have tried adding

this.GridView1.Attributes.Add("bordercolor", "#ddd"); 

This fixes the FireFox issue, but in IE it shows the dark lines.

Jason Plank
  • 2,336
  • 5
  • 31
  • 40
user131990
  • 31
  • 3

2 Answers2

1

Is there a reason why you are doing this programmatically?

If you open the html file (.ascx, .aspx) you should be able to set an inline style on the grid with style="border:1px solid #ddd;" or preferably use the CssClass property of the grid and point it at an externally defined style CssClass="myGridStyle" where myGridStyle is defined as

.myGridStyle {
   border:1px solid #ddd;
}
Jason Plank
  • 2,336
  • 5
  • 31
  • 40
rism
  • 11,932
  • 16
  • 76
  • 116
1

I know it's an old topic but needed solution for this too and @rism's solution did not apply , so i came up with simplest of all.

in css

td
{
 border:1px solid #ddd; 
}
Jacob
  • 914
  • 2
  • 10
  • 30