Removing rules="all" from the rendered table from a GridView

By default, the ASP.NET GridView control adds rules=”all” to its generated table HTML. It might not be terribly obvious how to remove it. I struggled for quite some time adding “border: none;” everywhere in my stylesheet, which wouldn’t remove the lines between the rows. Here is a sample:

Gridview Border Example

The answer is to simply use GridLines=”None” to the GridView declaration.

Kick It!

7 Comments so far »

  1. Ben said,

    Wrote on November 11, 2008 @ 9:46 am

    Thank you. I killed an hour trying to fix this. Bad dot net!

  2. Andrew said,

    Wrote on March 17, 2009 @ 5:46 pm

    Thank you – I was going INSANE – this fixed it.

  3. Uan said,

    Wrote on September 25, 2009 @ 9:48 am

    Thank you!

  4. Alok said,

    Wrote on October 15, 2009 @ 10:13 am

    Perfect, thx

  5. Dipanjan said,

    Wrote on October 16, 2009 @ 10:57 pm

    Thank!! Great findings :)

  6. Deputy Van Halen said,

    Wrote on January 6, 2010 @ 5:26 pm

    thanks brah

  7. HasanG said,

    Wrote on February 3, 2010 @ 10:54 am

    Finally found solution. Thanks…

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment: