Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ASP.net Gridview Row CssClass not working

  • 06-05-2009 11:51AM
    #1
    Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭


    Hi,

    I'm working on functionality to support Multi-line headers in the Gridview Row. It works by programmatically creating a new row, setting its values and then adding it to the Gridview.

    This all works fine except that the CssClass property isn't being applied. My code is simple and straightforward:
    row = new GridViewRow(_rowNumber, -1, DataControlRowType.Header, DataControlRowState.Normal);
    			_row.CssClass = _cssClass;
    

    Examining the row in Firebug confirms that the CssClass isnt being set, but strangely enough, if I set the CssClass to a td within the same row, it works fine!

    Anyone have any ideas about this? This functionality depends on the ability to set the <tr> css class :confused:

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    Where in the page lifecycle are you doing this?


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    Ginger wrote: »
    Where in the page lifecycle are you doing this?

    OnPreRender. The table cells are created & set in there as well and they work though...


  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    Are you by any chance using AlternatingRowStyle


  • Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭John_Mc


    Ginger wrote: »
    Are you by any chance using AlternatingRowStyle

    I am, but the rows I'm working with are the Header type, and not normal - so would using alternating rows interfere?


  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    http://forums.asp.net/p/1367813/2848353.aspx

    Just wondering if this is something thats happening


  • Advertisement
Advertisement