remove text-decoration in gridview

Last post 11-21-2008 11:14 AM by spaghetti writer. 4 replies.

Sort Posts:

  • remove text-decoration in gridview

    11-20-2008, 5:24 AM

    Hi,

     I've tried setting all the cssSettings to my style which includes the text-decoration:none; and I can't get rid of the underline on the header row. Am I missing something or is this not possibleĀæ

  • Re: remove text-decoration in gridview

    11-20-2008, 9:27 AM
    • All-Star
      20,690 point All-Star
    • A1ien51
    • Member since 05-06-2005, 2:46 PM
    • MD USA
    • Posts 3,806

     You about you show us some code.

    Eric

  • Re: remove text-decoration in gridview

    11-21-2008, 9:35 AM

    Hi,

     This is my GridView control:

    1            <asp:GridView
    2                ID="GridView1"
    3                runat="server"
    4                DataSourceID="AccessDataSource1"
    5                AllowSorting="True"
    6                AlternatingRowStyle-BackColor="#EEFFFF"
    7                AlternatingRowStyle-ForeColor="#000099"
    8                BorderStyle="Solid"
    9                ForeColor="#000099"
    10               HeaderStyle-BackColor="#000099"
    11               HeaderStyle-ForeColor="#EEFFFF"
    12               Font-Names="Calibri"
    13               Font-Size="16px"
    14               HeaderStyle-CssClass="headerRow">
    15           </asp:GridView>
    

     

    and this is my CSS

    1    .headerRow{
    2        text-decoration:none;
    3    }
    4    td{
    5        padding-left:10px;
    6        padding-right:10px;
    7    }
    8    
    9    th{
    10       text-decoration:none;
    11   }
    

    There isn't an issue with the CSS not being read as the <td> class is working.

    As you see, I've set the <th> as well, as this is what is generated by the GridView for the header. Neither this nor the .headerRow is having any effect i.e. the sort links are still underlined.

    Thanks

  • Re: remove text-decoration in gridview

    11-21-2008, 10:32 AM
    Answer
    • Participant
      894 point Participant
    • mckrecker
    • Member since 10-24-2008, 2:07 PM
    • Posts 170

     Try:

        .headerRow a {
    text-decoration:none;
    }
    Setting .headerRow (or th) that way just ensures that normal text is not underlined (which is already the default). You have to additionally specify that you don't want links (a) underlined.

     

    please mark as an answer if my reply helped
  • Re: remove text-decoration in gridview

    11-21-2008, 11:14 AM

    Thanks mckrecker, ".headerRow a " was what I was missing.

Page 1 of 1 (5 items)