Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Collapse]RichEditControl Document
    [Expand]Document Structure
    [Collapse]Document Elements
      Positions and Ranges
      Characters
      Paragraphs
      Inline Pictures
      Hyperlinks and Bookmarks
      Headers and Footers
      Tables
      Range Permissions
      Sections
      Styles
      Lists
      Floating Objects
      Text Boxes
      Comments
      Document Properties
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    AutoCorrect
    Mail Merge
    Restrictions and Protection
    Syntax Highlighting
    Traversing the Document
   [Expand]Visual Elements
    Services
    Events
    Commands
    HTML Tag Support
   [Expand]Examples
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Comments

The following topic describes how RichEditControl supports using comments in the document.

Expanded Manage Comments Manually

Create the Comment

To create a comment to the document range, use the following API.

Member Description
Paragraph.Range Retireves a range the given paragraph occupies.
SubDocument.FindAllFinds all document ranges that contain the given expression or text string.
SubDocument.Comments Provides access to the document's collection of Comment instances.
CommentCollection.Create Creates a new item in the CommentCollection.

The code snippet belows creates an empty comment associated with the specific phrase within the document.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T474988 .

Create a Nested Comment

The code snippet below demonstrates how to create a nested comment. To do that, use the CommentCollection.Create method with the passed parent comment.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T474988.


Edit the Comment

Edit the Comment Content

To accomplish this task, use the API from the table below.

Member Description
Comment.BeginUpdate Opens the given comment for modification.
SubDocument.InsertText Inserts a text string to the specified position.
TableCollection.Create Inserts a table to the specified position within the document.
ShapeCollection.InsertPicture Inserts a floating picture to a given document position.
DocumentImageCollection.Insert Inserts an inline image to the specified position.
ShapeCollection.InsertTextBox Inserts a text box to the given position.
Comment.EndUpdate Finalizes the comment update.

The following code sample adds text to the empty comment created earlier.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T474988 .

Edit the Comment Attributes

To change the comment parameters (author, date, etc.), use the following members.

Member Description
Comment.BeginUpdate Enables the comment modification.
Comment.Author Specifies the comment's author.
Comment.Date Specifies the comment's last modified date.
Comment.Name Specifies the comment name.
Comment.EndUpdate Finalizes the comment update.

The code snippet below changes the comment's name, date and the author of the following comment.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T474988.

The image below demonstrates the result of the code execution.

Delete the Comment

To remove a specific comment from the document, use the CommentCollection.Remove method as shown in the code snippet below.

Expanded Operate the Comments in the User Interface

Comment Displaying Options

The comments are displayed in the Reviewing Pane or in balloons that appear in the document margins. The corresponding ranges are highlighted by a distinct color for each reviewer.

To change the comment displaying options, such as range highlighting color or comment visibility, use the CommentOptions's class properties.

Tip

Adding new comments to the document can be forbidden. To do that, set the RichEditControl's DocumentCapabilitiesOptions.Comments property to Disabled.

Comments Functionality in the Command UI

End-users can insert, modify or remove the desired comment using the Review Ribbon tab. To learn how to provide the application with the ribbon menu, refer to the Lesson 5 - Create Separate Ribbon Pages for a Rich Text Editor topic.

The Comment group on the Review tab allows end-users to insert new comments, remove existing one(s) and navigate through all the comments in the document.

The Tracking group buttons allow end-users to highlight comments in the document, to filter them by the author, to specify whether to display the comments in the document margins or show the Reviewing Pane.

To provide the application with the Reviewing Pane, in XAML, set the RichEditControl.ShowReviewingPane property to true.

Is this topic helpful?​​​​​​​