views:

227

answers:

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.

Any thoughts?

Thanks

+1  A: 

Is there a reason why you 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; }

rism
A: 

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