CSS inheritance within RadTreeNode

2 posts, 0 answers
  1. Paul Robertson
    Paul Robertson avatar
    78 posts
    Member since:
    May 2010

    Posted 30 Jul 2011 Link to this post

    Hello

    Can anyone help with this CSS issue I have within my RadTreeNodes? The nodes of my RadTreeView are each instantiated with a node template that is dynamically loaded from an ASCX user control for each node using the Itemplate InstantiateIn method, as standard. This works fine, except that the markup generated for each node does not inherit the css styles from my external css stylesheet file that applies for the rest of the page. There is no problem with the styles and the file, it is something to do with the way that the user control is loaded. Normally I would expect to be able to insert a link in the ASCX markup, and for the control to link to the external CSS file that way:

    <link rel='stylesheet' type='text/css' href='~/mypath/mystylesheet.css' />

    This doesn't seem to work for a user control that is dynamically added when each RadTreeNode is instantiated. What is the recommended technique for allowing a user control to inherit CSS styles from the page, when the user control is used dynamically as the template for each node?

    Thanks very much if anyone can cast some light on this mystery.

    Regards

     
  2. Paul Robertson
    Paul Robertson avatar
    78 posts
    Member since:
    May 2010

    Posted 30 Jul 2011 Link to this post

    Update: I managed to fix this now. CSS inheritance does indeed work correctly for ASCX controls embedded in a node template, but only if you don't make any stupid mistakes that you don't notice for hours.

    Cheers

Back to Top