This is a migrated thread and some comments may be shown as answers.

CSS inheritance within RadTreeNode

1 Answer 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul Robertson
Top achievements
Rank 1
Paul Robertson asked on 30 Jul 2011, 05:49 PM
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

 

1 Answer, 1 is accepted

Sort by
0
Paul Robertson
Top achievements
Rank 1
answered on 30 Jul 2011, 07:01 PM
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

Tags
TreeView
Asked by
Paul Robertson
Top achievements
Rank 1
Answers by
Paul Robertson
Top achievements
Rank 1
Share this question
or