Back to Devexpress

ASPxRichEditSettings.SpellChecker Property

aspnet-devexpress-dot-web-dot-aspxrichedit-dot-aspxricheditsettings-26fd3888.md

latest5.3 KB
Original Source

ASPxRichEditSettings.SpellChecker Property

Provides access to the spelling settings for checking the RichEdit’s content.

Namespace : DevExpress.Web.ASPxRichEdit

Assembly : DevExpress.Web.ASPxRichEdit.v25.2.dll

NuGet Package : DevExpress.Web.Office

Declaration

csharp
public ASPxRichEditSpellCheckerSettings SpellChecker { get; }
vb
Public ReadOnly Property SpellChecker As ASPxRichEditSpellCheckerSettings

Property Value

TypeDescription
ASPxRichEditSpellCheckerSettings

A ASPxRichEditSpellCheckerSettings object that holds the spelling options.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to SpellChecker
ASP.NET MVC ExtensionsRichEditSettings

.Settings .SpellChecker

| | ASP.NET Web Forms Controls | ASPxRichEdit |

.Settings .SpellChecker

|

Remarks

Example

ASPxRichEdit built-in spell checking support, including the type-as-you-go error detection. End-users can correct a misspelled word in the Spelling dialog. It can be opened using the corresponding context menu’s item when a cursor is over the misspelled word. This dialog allows a user to select spelling suggestions (they are also displayed in the context menu), change or ignore the error once or in all cases, and add a new word to the dictionary. You can also invoke the Spelling dialog using the client-side openSpellingDialog command. In this example, ASPxRichEdit includes a custom ribbon button: clicks on this item are processed using the client-side CustomCommandExecuted event. The event handler identifies the custom item via a command name and executes the openSpellingDialog command.

javascript
function onRichEditCustomCommandExecuted(s, e) {
    if(e.commandName = "OpenSpellingDialog") {
        RichEdit.commands.openSpellingDialog.execute();
    }
}
aspx
<dx:ASPxRichEdit ID="RichEdit" runat="server" ClientInstanceName="RichEdit">
    <ClientSideEvents CustomCommandExecuted="onRichEditCustomCommandExecuted" />
    <Settings>
        <SpellChecker Enabled="true" SuggestionCount="4">
        <Dictionaries>
            <dx:ASPxSpellCheckerISpellDictionary
                AlphabetPath="EnglishAlphabet.txt"
                GrammarPath="english.aff"
                DictionaryPath="american.xlg"
                Culture="English (United States)"
                CacheKey="ISpellDic">
            </dx:ASPxSpellCheckerISpellDictionary>
        </Dictionaries>
    </SpellChecker>
    </Settings>
    <RibbonTabs>
        <dx:RibbonTab Text="Review">
            <Groups>
                <dx:RibbonGroup Text="Proofing">
                    <Items>
                        <dx:RibbonButtonItem 
                            Name="OpenSpellingDialog"
                            Text="Spelling"
                            Size="Large"
                            LargeImage-IconID="format_spellcheck_32x32gray">
                        </dx:RibbonButtonItem>
                    </Items>
                </dx:RibbonGroup>
            </Groups>
        </dx:RibbonTab>
    </RibbonTabs>
</dx:ASPxRichEdit>
csharp
string documentId = "docId";
protected void Page_Load(object sender, EventArgs e) {
    if(!IsPostBack) {
        RichEditDocumentServer server = new RichEditDocumentServer();
        server.LoadDocument(Server.MapPath("~/SpellChecking.docx"));
        DocumentManager.CloseDocument(documentId);
        RichEdit.Open(documentId, DocumentFormat.OpenXml, () => server.OpenXmlBytes);
    }
}
vb
Private documentId As String = "docId"
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    If Not IsPostBack Then

        Dim server_Renamed As New RichEditDocumentServer()
        server_Renamed.LoadDocument(Server.MapPath("~/SpellChecking.docx"))
        DocumentManager.CloseDocument(documentId)
        RichEdit.Open(documentId, DocumentFormat.OpenXml, Function() server_Renamed.OpenXmlBytes)
    End If
End Sub

See Also

ASPxRichEditSettings Class

ASPxRichEditSettings Members

DevExpress.Web.ASPxRichEdit Namespace