how to assign a css class to datagrid header that is a link?

Discussion in 'ASP .Net Datagrid Control' started by djc, Nov 5, 2004.

  1. djc

    djc Guest

    I have a datagrid that has several sortable columns. So the headers become
    hyperlinks. I need to be able to assign a css class to just these
    hyperlinks? how can I do that? For example, right now I can just assign css
    styles to the A tag which does control them but that also controls ALL the
    other links on the page, which I don't want.

    is there a way? (other than assigning other classes to all the *other*
    hyperlinks on the page ... which *is* my plan B)

    any input is appreciated. Thanks.
     
    djc, Nov 5, 2004
    #1
    1. Advertising

  2. djc

    Jos Guest

    djc wrote:
    > I have a datagrid that has several sortable columns. So the headers
    > become hyperlinks. I need to be able to assign a css class to just
    > these hyperlinks? how can I do that? For example, right now I can
    > just assign css styles to the A tag which does control them but that
    > also controls ALL the other links on the page, which I don't want.
    >
    > is there a way? (other than assigning other classes to all the *other*
    > hyperlinks on the page ... which *is* my plan B)
    >
    > any input is appreciated. Thanks.


    Set the CssClass property, and use a class (let's call it "header") like
    this:

    ..header { color:blue; } // style of header itself goes here
    ..header A { color:red; etc; etc; } // style of link goes here

    --

    Jos
     
    Jos, Nov 6, 2004
    #2
    1. Advertising

  3. djc

    djc Guest

    you just made my day Jos! I thought it was something that would wind up
    being handled completely within css and not an aspnet thing. I read a book
    on CSS some time ago but I just couldn't remember that syntax. (i don't use
    it often only because programming/webdesign is not actually my job... more a
    hobby) I need to review that book man. Thank you!


    "Jos" <> wrote in message
    news:%...
    > djc wrote:
    > > I have a datagrid that has several sortable columns. So the headers
    > > become hyperlinks. I need to be able to assign a css class to just
    > > these hyperlinks? how can I do that? For example, right now I can
    > > just assign css styles to the A tag which does control them but that
    > > also controls ALL the other links on the page, which I don't want.
    > >
    > > is there a way? (other than assigning other classes to all the *other*
    > > hyperlinks on the page ... which *is* my plan B)
    > >
    > > any input is appreciated. Thanks.

    >
    > Set the CssClass property, and use a class (let's call it "header") like
    > this:
    >
    > .header { color:blue; } // style of header itself goes here
    > .header A { color:red; etc; etc; } // style of link goes here
    >
    > --
    >
    > Jos
    >
    >
     
    djc, Nov 6, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    860
    Kevin Spencer
    May 17, 2005
  2. mlt
    Replies:
    2
    Views:
    851
    Jean-Marc Bourguet
    Jan 31, 2009
  3. Maziar Aflatoun

    Assign CSS to DataGrid header

    Maziar Aflatoun, Dec 20, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    129
    Peter Markusek
    Dec 21, 2004
  4. Henrik
    Replies:
    1
    Views:
    428
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
  5. datagrid having row header and column header

    , Jul 13, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    185
Loading...

Share This Page