Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
    Overview
   [Expand]Getting Started
   [Collapse]Fundamentals
    [Expand]RichEditControl
    [Collapse]Document
      Document Model
      Document Layout
      Positions and Ranges
      Characters
      Paragraphs
      Inline Pictures
      Document Fields
      Hyperlinks and Bookmarks
      Headers and Footers
      Tables
      Range Permissions
      Sections
      Styles
      Numbered and Bulleted Lists
      Floating Objects (Shapes)
      Text Boxes
      Comments
      Document Properties
     Supported Document Formats
    [Expand]Fields
     Commands
     Services
     Layout API
     Product Class Structure
     Default Keyboard Shortcuts
     Measure Units
     HTML Tag Interpretation
   [Expand]Concepts
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[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.

Show Me

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

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.

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 How to: Create a Simple Word Processor with a Ribbon UI 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 the designer mode, click the RichEditControl's smart tag and select Create Reviewing Pane.

Tip

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

How would you rate this topic?​​​​​​​