Apply CSS Class from different CSS file

4 posts, 0 answers
  1. Zach
    Zach avatar
    13 posts
    Member since:
    Jan 2009

    Posted 10 Mar 2010 Link to this post

    I think I already know the answer to this question, but thought I'd pose it as a suggestion if the functionality does not already exist.  We want the content of our RadEditor to look the same as it would once it is submitted (meaning it should pull in all the CSS files of the page it is on).  However, we only want the Apply CSS class dropdown to pull from a single CSS file that we specify.  The CssClasses route is not a solution for us, because the CSS file that should populate the dropdown might have anywhere between 1 and hundreds of declarations, all of which could change and would then have to be updated in two places.  So my question/suggestion is, is there any way to make the Editor display area pull in the page's styles, while forcing the "Apply CSS Class" dropdown to only pull in from a declared file?

  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 11 Mar 2010 Link to this post

    I assuming this is what your asking about or maybe I'm wrong, but here's the link to the help topic.

    You can set the CssFiles collection and add the CSS files you want to include in the editor and it will use it as the base for the "Apply CSS Class" drop-down.
  3. DevCraft R3 2016 release webinar banner
  4. Zach
    Zach avatar
    13 posts
    Member since:
    Jan 2009

    Posted 11 Mar 2010 Link to this post

    This method also overrides the styles the main WYSIWIG region gets though.  I want the WYSIWIG to pull in the styles from the page, while the Apply CSS class dropdown only gets what I specify in a declaration similar to what you're talking about.
  5. Rumen
    Rumen avatar
    12782 posts

    Posted 12 Mar 2010 Link to this post

    Hi Zach,

    The requested feature is not supported out-of-the box by the Apply Class dropdown, which displays the classes applied to the content area. If you would like you can implement your own custom dropdown that will list only the classes that you want to display.

    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top