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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP.net Gridview Row CssClass not working

  • 06-05-2009 10: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