locked
Where in CSS to change hyperlink color of DDGridView RRS feed

  • Question

  • User-1169605399 posted

    I have a strange problem, I cannot seem to find out where to change the link color of the DDGridview in my Dynamic Data site.  I have gridview like so:

    <asp:GridView ID="grdAgency" runat="server" AutoGenerateColumns="false" CssClass="DDGridView" RowStyle-CssClass="td" HeaderStyle-CssClass="th" CellPadding="3" CellSpacing="3" Width="280">

     

    and changing this link color to red in CSS yields no color change:

    table.DDGridView .td a, table.DDListView .td a

    {

        color: #ff0000;

        text-decoration: none;

        margin-right: 6px;

    }

     

    Any clues why my style is not working?

    Wednesday, March 16, 2011 1:37 PM

Answers

  • User-330204900 posted

    Hi Matt, you may have to a !important to some of you settings as the default DD css is no speific and so affects every link.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 12:48 PM

All replies

  • User-1713050958 posted

    Use pseudo class of link in css to access and define css properties:

     

    <style type="text/css">
    A:link {text-decoration: none;color: green;}
    A:visited {text-decoration: none}
    A:active {text-decoration: none}
    A:hover {text-decoration: underline; color: red;}
    </style>

     

     

    Hope this answer your question


    Please mark as answer if this solve your problem

    DevTechie.com

    Wednesday, March 16, 2011 2:23 PM
  • User-1169605399 posted

    I've tried that, and it doesn't work.

    Wednesday, March 16, 2011 3:36 PM
  • User232504566 posted

    table.DDGridView .td a, table.DDListView .td a
    {
        color: #718ABE;
        text-decoration: none;
        margin-right: 6px;
        
    }

    table.DDGridView .DDSelected a, table.DDListView .DDSelected a
    {
        color: #718ABE;
        text-decoration: none;
        margin-right: 6px;   
    }

    table.DDGridView .DDSelected a:hover, table.DDListView .DDSelected a:hover
    {
        color: #000099;
        text-decoration: underline;
    }

    table.DDGridView .td a:hover, table.DDListView .td a:hover
    {
        color: #000099;
        text-decoration: underline;
    }

     

    Change your text color and text decoration there.

     

    table.DDGridView .th a, table.DDListView .th a
    {
        color: #666;
        text-decoration: none;
    }

    This will change the color of the colum names as long as they are sortable.

    I just tryed it on my project and it works fine. If your asp:hyperlinks dont have a navigationURL then they wont pick up the attriibute.

    Wednesday, March 16, 2011 4:19 PM
  • User443262777 posted

    I think that if you are have created your .aspx pages using a master page then any other .css setting will be overriden by the master one. That is my guess. Thank you

    Thursday, March 17, 2011 9:10 AM
  • User-330204900 posted

    Hi Matt, you may have to a !important to some of you settings as the default DD css is no speific and so affects every link.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 17, 2011 12:48 PM
  • User-1169605399 posted

    Stephen all very good suggestions.   I *do* have master pages and need to add !important to the DDGRidView link color attribute to make that color value override the ones specified on the body template style.  Thanks, (I am not a CSS guy really) - Matt

    Thursday, March 17, 2011 2:15 PM