Skip to main content
A newer version of this page is available. .

How to: Open SpellChecker dialog via Ribbon

  • 3 minutes to read

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.

using DevExpress.Web.Office;
using DevExpress.XtraRichEdit;
using System;

public partial class _Default : System.Web.UI.Page {
    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);
        }
    }
}