[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Collapse]Spreadsheet
   [Expand]Product Information
    Getting Started
   [Collapse]Concepts
    [Collapse]Spreadsheet Document
      Workbook
      Worksheets
      Cells and Cell Ranges
      Rows and Columns
      Comments
      Measure Units
     Supported Formats
     Import and Export
    [Expand]Cell Basics
    [Expand]Spreadsheet Formulas
     Defined Names
     Data Validation
    [Expand]Data Presentation
    [Expand]Charting
     Printing
    [Expand]Mail Merge
     Protection
     Adaptivity
     Keyboard Shortcuts
   [Expand]Visual Elements
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard 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 SpreadsheetControl allows you to attach notes to individual cells by using comments. Comments are extremely useful when you need to provide additional information, such as reminders, notifications, or feedback in a document without modifying cell content.

Comments are stored separately from a cell and displayed in a floating text box. A cell containing a comment has a red triangular indicator in the corner.

See Online Demo: Comments

Select the action you wish to perform.

Expanded Add a Comment

All comments embedded in a worksheet are stored in the comment collection (CommentCollection), which can be accessed by using the Worksheet.Comments property. The CommentCollection interface provides the basic methods to work with comments. Use the CommentCollection.Add method to attach a comment to a cell. For an example, refer to How to: Create, Edit and Copy Cell Comments.

An individual comment is represented by the Comment object and can be accessed by its index in the comment collection. The Comment object provides the following properties to specify a comment.

Property

Description

Comment.Author Gets or sets the author of the comment.
Comment.Text Gets or sets the comment text.
Comment.Runs Provides access to the separate text regions of the comment.
Comment.Reference Gets an absolute reference to the commented cell.
Comment.Visible Specifies whether the comment should always be displayed in the UI.

Expanded Edit a Comment

Comment text consists of one or more comment runs. Each run is represented by the CommentRun object and defines a region of the comment text with specific formatting. Currently, the SpreadsheetControl does not support text formatting for comments. However, you can use comment runs to change the text of the existing comments or add new text blocks to them.

All runs for an individual comment are stored in the CommentRunCollection accessible using the Comment.Runs property. After a comment is created, its text is defined by a single run contained in the collection. Use the collection's CommentRunCollection.Add and CommentRunCollection.Insert methods to add new text to the required comment. To edit the text of the existing comment run, get access to this run by its index in the collection and utilize the CommentRun.Text property. To replace the text of the entire comment, use the Comment.Text property.

For an example, refer to How to: Create, Edit and Copy Cell Comments.

Expanded Copy a Comment

To copy a comment to another cell, call the Range.CopyFrom method for the target cell into which you wish to insert the comment. Pass the PasteSpecial.Comments enumerator value as a parameter to copy the comment only and ignore cell content. The copied comment will replace any existing comment contained in the target cell. For an example, refer to How to: Create, Edit and Copy Cell Comments.

Expanded Delete Comments

To delete an individual comment from the collection, use the CommentCollection.Remove or CommentCollection.RemoveAt method. To remove comments from a specified range of cells, utilize the Worksheet.ClearComments method. To delete all comments from a worksheet, use the CommentCollection.Clear method. For an example, refer to How to: Clear Cells of Content, Formatting, Hyperlinks and Comments.

Expanded Manage Comments in the UI

End-users can insert, edit, hide or delete comments using one of the following ways.

  • Via the ribbon UI (by using the commands located in the Comments group of the Review tab)

  • Via the context menu

Moreover, end-users can resize a comment or move it to a new location by using the sizing handles (small rectangles at the corners and sides of the comment box) visible for a selected comment.

Expanded See Also

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