Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP.net Gridview Row CssClass not working

Options
  • 06-05-2009 11:51am
    #1
    Registered Users Posts: 2,791 ✭✭✭


    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 Posts: 2,931 ✭✭✭Ginger


    Where in the page lifecycle are you doing this?


  • Registered Users Posts: 2,791 ✭✭✭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 Posts: 2,931 ✭✭✭Ginger


    Are you by any chance using AlternatingRowStyle


  • Registered Users Posts: 2,791 ✭✭✭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 Posts: 2,931 ✭✭✭Ginger


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

    Just wondering if this is something thats happening


  • Advertisement
Advertisement