How Do? Modify CssClass for Specific Select Column in Datagrid

Discussion in 'ASP .Net' started by Joey, Jan 16, 2006.

  1. Joey

    Joey Guest

    I have noticed that the grid's Select linkbutton is rendered as an HTML
    anchor tag on the client. I would really like to be able to get a
    "class" attribute in it, either through CssClass on the serverside
    DataGridLinkButton control or through Attributes.Add or something
    similar?

    I thought I could use ItemDataBound and
    ((DataGridLinkButton)e.Item.Cells[6].Controls[0]).CssClass, but it says
    that DataGridLinkButton is inaccessible to its protection level. I have
    a couple of other approaches
    (this.grdMyGrid.Columns[6].ItemStyle.CssClass <- changes the cell
    style, but not the anchor tag within it ; also tried page-level style
    for anchor tag, but I need that for other anchor elements on the page),
    but they didn't work either.

    Any ideas?
     
    Joey, Jan 16, 2006
    #1
    1. Advertising

  2. Joey

    Joey Guest

    I finally got it. Should have used LinkButton, even though GetType()
    was returning DataGridLinkButton.
     
    Joey, Jan 17, 2006
    #2
    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. =?Utf-8?B?U3RldmUgS2FsbGFs?=

    CssClass on DataGrid Edit, Update & Cancel buttons

    =?Utf-8?B?U3RldmUgS2FsbGFs?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    743
    =?Utf-8?B?U3RldmUgS2FsbGFs?=
    Jul 6, 2004
  2. =?Utf-8?B?a2g=?=

    DataGrid.AllowSorting and CssClass

    =?Utf-8?B?a2g=?=, Aug 2, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,562
    Joe Fallon
    Aug 3, 2004
  3. Laurence Neville

    Datagrid CssClass being overridden by TD style

    Laurence Neville, Sep 22, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    5,130
    Laurence Neville
    Sep 23, 2004
  4. TS
    Replies:
    3
    Views:
    420
    Walter Wang [MSFT]
    Aug 16, 2007
  5. WebRaster
    Replies:
    1
    Views:
    286
    Francisco Spaeth
    Oct 26, 2005
Loading...

Share This Page