KB Article T190808
Visible to All Users

ASPxRichEdit - Known issues and frequently asked questions (FAQ)

Description:
UPDATED:

In version 15.1, we've published the ASPxRichEdit control. It provides the same functionality as our WinForms XtraRichEdit control, except for support of certain features. We are working on improving the ASP.NET RichEdit control and are going to add additional features in future releases. However, even now it is a very flexible and powerful control that allows our users to enjoy all features of great text editors (like Microsoft Word) online.

As our users know, since 2008 we also offer an excellent ASPxHtmlEditor control to edit HTML content. At first glance, these controls (ASPxHtmlEditor  and ASPxRichEdit) are quite similar. However, these are very different components. The main conceptual difference is that ASPxHtmlEditor was created to edit HTML data while ASPxRichEdit  is designed to work with rich text content. Both controls have some limitations, however, if ASPxHtmlEditor has a certain limitation, it doesn't mean that ASPxRichEditor  has it as well, and vice versa. In this article, we've structured all known issues related to the ASPxRichEdit control and important information about this component. The article will be complemented with all frequently asked questions and reliable information.

Known issues:
   1. Only a single underline style is displayed correctly. Other ones (dotted, dashed, double, etc.) aren't.
 NEW2. Not all types of a table borders are supported

Frequently asked questions:
   1. Why the previously opened document content is still shown when I open another document?
   2. Why an ASPxRichEdit document content's appearance is different in different browsers?
   3. How to able to prevent certain operations (such as open/save or copy/paste)?
   4. How to edit a document saved in a database?
   5. How to operate with a document content on the client side?
   6. How to handle changing text?
   7. Why requests are sent to the server when a user types in the editor?
   8. How to check if a document has modifications on the client and server side?
   9. Why page settings such as margins, paper kind, size are not applied when opening or saving a document with the Html document format?
   10. Why ASPxRichEdit displays some glyph symbols instead expected characters?
   11. Why ASPxRichEdit  cannot display some symbols (like the "Registered Trademark" symbol) in symbol fonts in Firefox
   12. How to protect a document?
   13. Why some RichEdit settings may be not applied when the RichEditExtension.GetCallbackResult method's result is returned from the callback controller action in MVC?
   14. How to insert HTML or RTF content into a document on the client side?
   15. How to hide or customize the built-in context menu?
   16. Is it possible to open a PDF document in ASPxRichEdit?
   17. I used the "Add to dictionary" option in the spell checker to add a new word in my physical dictionary. Why isn't this word displayed in my physical dictionary file?
   18. How to obtain the modified text displayed in the header and footer on the server side?
   19. Why is XYZ possible in ASPxRichEdit but impossible in ASPxHtmlEditor (or vice versa)?
   20. Our users need the XYZ functionality, but currently, ASPxRichEdit doesn't support it. Can you let me know whether and when it will be implemented?

Answer:
Known issues.
   1. Only a single underline style is displayed correctly. Other ones (dotted, dashed, double, etc.)  aren't.

Only a single underline style exists in CSS (using the text-decoration property). We apply changes on the document model correctly. You can check it using any other rich text editor or by executing the Print command. However, we cannot show different underline styles in a browser because of CSS limitations.

2. Not all types of a table borders are supported

Currently, ASPxRichEdit fully supports the following table cell line types: single, dashed, dotted. We do not guarantee that other line types will be displayed correctly for table cell borders because of HTML element rendering specifies.

Frequently asked questions.

1. Why the previously opened document content is still shown when I open another document?

This is expected behavior. When a document is opened in this ASPxRichEdit, a special session value stores its state on the server. When you modify the document, these changes are stored in this session and displayed in the control all the time the document remains open.
If you need to refresh the saved document state, close the required document on the server side using DocumentManager static methods. Use the DocumentManager.CloseDocument method passing a DocumentId as a parameter or the DocumentManager.CloseAllDocuments method for this purpose.
Please note that we don't recommend you call these method to close a document without opening another one directly after this method call. Note that the DocumentManager.CloseDocument and DocumentManager.CloseAllDocuments methods remove the server document model for this control and as a result they remove its server-side instance. They should be used only to close a currently opened document to open another one and should be followed by the Open method call.
In order to open a new document in RichEdit on a button click, you use the client-side fileNew command instead of closing a document via CloseDocument. For example:

JavaScript
RichEdit.commands.fileNew.execute();

2. Why an ASPxRichEdit document content's appearance is different in different browsers?

This behavior is expected and related to the RichEdit design. Note that ASPxRichEdit uses the Flow document format to display documents. This means that a document is represented as a set of objects such as text, paragraph, section, table, picture. The location of elements on a page is calculated when the document is displayed, and depends on the currently used device and browser.
The control needs to know the size of the document's text to calculate its layout. An inner measurer that calculates the text size takes its basic rows' size from the currently used browser. Measures of browsers are different and return different sizes for the same font types and sizes. This means that with different browsers ASPxRichEdit can produce different row counts. Therefore, the way a document is shown on a page depends on the browser specificity.

3. How to able to prevent certain operations (such as open/save or copy/paste)?

The Behavior and DocumentCapabilities new properties have been implemented in version 15.1.
Settings available through these properties enable you to prevent certain operations (such as open/save or copy/paste) from being performed within a document and to limit the document characteristics (such as character or paragraph formatting) that can be changed. See the Document and Operation Restrictions demo illustrating this functionality in action.

4. How to edit a document saved in a database?

In version 15.1, we have implemented several overloads of the Open method and the new SaveCopy methods, which can save a copy of an opened document to a specific file path, a stream, or an array of bytes.
The How to use ASPxRichEdit to edit RTF data in ASPxGridView's EditForm example illustrates a possible way to use a newly implemented API.

5. How to operate with a document content on the client side?

In version 15.1, we have extended ASPxRichEdit's client-side API and added functionality that allows you to manipulate opened documents programmatically on the client side.
The client manipulation API can be used via the following properties:
document  Provides access to structures allowing you to obtain the current information about certain document structural elements (such as sections, active sub-document, styles for characters, paragraphs and tables, and etc).
selection Provides access to a set of methods allowing you to position the cursor within a document and to select document content elements.
commands Provides access to client commands allowing you to programmatically accomplish virtually any task within a document (such as inserting characters, paragraphs, tables and pictures, changing element formatting, creating numbered lists, etc).
Please refer to the Client Command API demo demonstrating this client-side functionality.

6. How to handle changing text?

There is no access to the document model on the server side. In addition, RichEdit requests to the server are processed by a special handler (not by the page itself), so there is no capability to raise a server-side event once the editor's content is changed. On the client side, there are the ContentInserted and ContentRemoved events to handle content changes.

7. Why requests are sent to the server when a user types in the editor?

This is expected behavior that in some situations ASPxRichEdit sends requests to the server. They allow the control to synchronize its client-side document and the server document model so that each time they contain the same data.
When there are no changes in a document, ASPxRichEdit doesn't initiate synchronization with the server. Once a user types something in the document, a timer starts and in 5 seconds a request is sent to the server, which sends modifications made by a user. The same behavior occurs as soon as any other changes made in the opened document.
Such requests may also be sent when a large document is opened. In the case of a small document, it's fully loaded on the first page load. However, when a document is quite large, only its part is loaded first and the rest of the document is loaded via such requests on demand, for example, when a user scrolls it.
It's not possible to prevent this behavior because ASPxRichEdit work is based on this functionality and it supplies interaction between RichEdit's server and client parts. For more information, see the following help topic: Client-Server Document Synchronization.

8. How to check if a document has modifications on the client and server side?

It's possible to check a document's modified status both on the server and client side.To check if a document was modified, you can use the client-side HasUnsavedChanges method. To accomplish this task on the server side, obtain this document via DocumentManager by passing DocumentId to the FindDocument method and get its Modified property:

C#
DevExpress.Web.Office.DocumentManager.FindDocument(ASPxRichEdit1.DocumentId).Modified;

9. Why page settings such as margins, paper kind, size are not applied when opening or saving a document with the Html document format?

This is expected behavior because the Html format does not support or save page settings (like margins, paper kind, size, etc.). In order to save or apply these page settings, open the document in a format supporting these settings, such as Docx, Rtf, etc.

10. Why ASPxRichEdit displays some glyph symbols instead expected characters?

In some cases when a custom font is used in a document opened in ASPxRichEdit, expected characters may be shown as glyph symbols. To display font characters in a document's content, our control uses the browser's inner font collection and fonts load by using the @font-face rule. The control does not have its own inner font collection. So, to open and display a document with non standard fonts, it's necessary to register them explicitly in the @font-face rule:

ASPx
@font-face { font-family: 'Symbol'; src: url("PathToFontFile.woff") format('woff'); }

Refer to the ASPxRichEdit - How to make the editor work correctly with custom fonts KB article which describes in detail the specificity of working with custom fonts in our ASPxRichEdit.

11. Why ASPxRichEdit  cannot display some symbols (like the "Registered Trademark" symbol) in symbol fonts in Firefox

This problem occurs due to the fact that Firefox doesn't display the Symbol font and ignores the 'Symbol' font in the TrueType format. Since this behavior is related to the Firefox internal work specificity, we cannot fix it on our side. See the RichEdit cannot display symbols (like the "Registered Trademark" symbol) in symbol fonts thread where this behavior is described in detail.

12. How to protect a document?

Starting with version 17.2 our ASPxRichEdit control provides the Document Protection functionality. It allows you to work with protected documents and disable editing some document parts/full document for a unique user or user group. See the Document Protection demo to see this functionality in action.

13. Why some RichEdit settings may be not applied when the RichEditExtension.GetCallbackResult method's result is returned from the callback controller action in MVC?

Due to its design specificity, the MVC RichEdit extension does not allow reflecting settings that are defined in a partial view. Therefore, it's not possible to maintain the RichEdit current settings by calling the RichEditExtension.GetCallbackResult method call in the callback controller action and returning this method's result. The actual RichEdit settings should be always defined in its partial view. As a solution, you can use the standard mechanism: return a partial view in the corresponding controller action instead of using the RichEditExtension.GetCallbackResult method and define all the required RichEdit settings in this partial view.

14. How to insert HTML or RTF content into a document on the client side?

Starting with version 17.1.7, ASPxRichEdit has the client-side insertHtml command that allows you to insert HTML formatted content instead of a selected range on the client side. You can see the list of HTML tags supported by this control in the insertHtml article. Note that the command does not support the style tag and CSS attributes.

Starting with version 18.1, the ASPxRichEdit control has the insertRtf command, which allows you to add formatted RTF content at the specified position.

15. How to hide or customize the built-in context menu?

Our ASPxRichEdit control provides the functionality which allows you to hide or customize the built-in context menu. This feature is available starting with version 17.2. Use the PopupMenuShowing event handler to perform this customization. Refer to the Context Menu Customization online demo to see how to use this functionality.

16. Is it possible to open a PDF document in ASPxRichEdit?

The ASPxRichEdit control doesn't provide the functionality to open PDF files. Please refer to the Main Features article, which describes formats supported by this control. It allows only opened documents' export to PDF. See the Export to PDF demo illustrating this capability.
We don't have a ready-to-use control to show PDF files. As a workaround, use the solution provided in the How to implement a simple PDF viewer in ASP.NET WebForms web application by using the Document Server functionality example.

17. I used the "Add to dictionary" option in the spell checker to add a new word in my physical dictionary. Why isn't this word displayed in my physical dictionary file?

Currently, ASPxRichEdit doesn't save changes made by a user in the physical dictionary file and stores them in a Session variable. If you need to save changes from the temporary dictionary stored in the Session to the dictionary file, use the approach described in the ASPxRichEdit - How to save words added via the "Add to Dictionary" option to a custom physical dictionary example.

18. How to obtain the modified text displayed in the header and footer on the server side?

The SaveCopy method doesn't allow you to obtain the plain text from the document's header and footer. In order to obtain the current text displayed in ASPxRichEdit's header and footer, it's necessary to use RichEditDocumentServer. See the ASPxRichEdit - How to get the actual header's and footer's text content on the server side KB article which describes this approach in details.

19. Why is XYZ possible in ASPxRichEdit but impossible in ASPxHtmlEditor (or vice versa)?

Despite their visual similarity, ASPxRichEdit  and ASPxHtmlEditor  are absolutely different controls that are implemented in different ways. Of course, each implementation has restrictions. However, these restrictions are different for these controls. If you cannot do something using one of them, it's possible that it can be easily achieved with the other.

20. Our users need the XYZ functionality, but ASPxRichEdit doesn't support it yet. Can you let me know whether and when it will be implemented?

We're deeply interested in making the control more flexible and user-friendly. So, your suggestions are appreciated. If you have an idea on how to improve the control, feel free to post a new thread in our Support Center describing the task in detail. Please note that the more information you provide about your real scenario where a certain feature is needed, the more precise solution we'll be able to offer.

Show previous comments (7)
MH MH
Michael Head 2 9 years ago

    Lists work great, thank you. Do you know when TextBox support will be added? We need to change from your Silverlight to the HTML5/ASPx RTF Editor and this is the last item that is causing problems.

    DevExpress Support Team 9 years ago

      Hi Michael,

      At the moment, we don't have exact ETA for this task. We would appreciate if you provide us with your feedback on this feature and describe your use case in greater detail.

      DevExpress Support Team 8 years ago

        Hi,

        Starting with version 17.2 we are going to support Document Range Protection and several other features in ASPxRichEdit. I invite you to evaluate them in our 17.2 Alpha release. I would love to hear your feedback regarding it.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.