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

Telerik editor spellcheck

1 Answer 42 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ritu
Top achievements
Rank 1
Ritu asked on 19 Aug 2011, 09:03 AM
Hi,

I am using the telerik editor in an mvc project. I can see a lot of tools for formatting eg, Font, indentation, bulleting etc, but is there no tool for spell check included in the editor? What do we need to do to incorporate this feature into the standard telerik editor?

Ritu

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 22 Aug 2011, 02:51 PM
Hello Ritu,

You can use the RadSpell control to perform the spell check. You would only need to use a custom text provider as explained in this help article. Here follows a small example:
<telerik:RadSpell id="RadSpell1" runat="server" buttontype="None"  HandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"  IsClientID="true"/>
 
  <%Html.Telerik().Editor()
          .Name("Editor1")
           .Value(() =>
                        {
%>
<%: "some diliberate mistakez"%>
<%
                        })
          .Encode(false)
          .Tools(tools => tools.Clear()
               .Custom(spellCheck => spellCheck.HtmlAttributes(new
                {
                    style = "background-image: url(\"/Images/icon_spellcheck.png\");",
                    onclick = "spellCheck(event)",
                    title = "Check the spelling of the text.",
                    id="home"
                }))
                )
               .Render(); %>

var CustomTextSource = function (editor)
{
    this._editor = editor;
    this.get_text = function () { return this._editor.value(); };
    this.set_text = function (value) { this._editor.value(value); };
}
 
function spellCheck(e)
{
    var editor = $("#Editor1").data("tEditor");
    var spell = GetRadSpell('<%= RadSpell1.ClientID %>');
    spell.spellCheck(new CustomTextSource(editor));
}


Regards,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Editor
Asked by
Ritu
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or