Rad editor fire command

2 posts, 0 answers
  1. Kranthi
    Kranthi  avatar
    1 posts
    Member since:
    Oct 2012

    Posted 10 Feb 2016 Link to this post

    My query is regarding Rad Editor.
    The problem is when I create a custom commands in rad editor to apply styles to content as font size, font type etc.,.
    But at the same when I try to apply CSS class to content it is not working for me.
    Below is my Code

    Below is the code working

    EditorCommandList["Mandatory"] = function (commandName, editor, args) {

                if (editor.getSelectionHtml() != "") {
                    editor.fire("FontSize", { value: "40" });

    Below is the code not working

    EditorCommandList["GuideLines"] = function (commandName, editor, args) {

                if (editor.getSelectionHtml() != "") {

                    editor.fire("ApplyClass", { value: "radGuideLines " });


    In the above code when i try apply a class using "ApplyClass" command it is not working.

    Please provide me solution ASAP.





  2. Nikolay
    Nikolay avatar
    89 posts

    Posted 12 Feb 2016 Link to this post


    I have debugged this and found out that ApplyClass command expects a EditorCommandEventArgs object parameter instead of json. Please try the following:
    editor.fire("ApplyClass", new Telerik.Web.UI.EditorCommandEventArgs("ApplyClass", null, "radGuideLines "))

    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 Feedback Portal and vote to affect the priority of the items
Back to Top