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

Adding a Custom Language to Code Blocks?

1 Answer 49 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 06 Jun 2011, 11:11 PM
I'm working with a client who uses the telerik editor in their community forum.  As a tech company they have a priority language for one of their devices (it closely follows C#).  While the Code Block Editor is great, they have been asking me about adding in some minor changes to the formatting rules to better represent their specific language syntax and color coding.

Is this possible?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 09 Jun 2011, 12:48 PM
Hello Steven,

You can get access to the content inserted via the FormatCodeBlock dialog using the OnClientPasteHtml event of RadEditor, e.g.

<script type="text/javascript">
    function OnClientPasteHtml(sender, args) {
        var commandName = args.get_commandName();
        var value = args.get_value();
        if (commandName == "FormatCodeBlock") {
            //modify and set new content
            args.set_value("new content");
        }
    }
</script>
<telerik:RadEditor runat="server"
OnClientPasteHtml="OnClientPasteHtml"
ImageManager-ViewPaths="~/"
ID="RadEditor1">
</telerik:RadEditor>

Once you obtain the content in this event you can modify it.

You can see how to access the contents of the dialog in this demo: Customize Built-in Dialogs.

Best regards,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Editor
Asked by
Steven
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or