Skip to content

Commit 24624ba

Browse files
996221: Updated the comment UG content with the review comments.
1 parent 221e648 commit 24624ba

File tree

4 files changed

+72
-68
lines changed

4 files changed

+72
-68
lines changed

Document-Processing/Excel/Spreadsheet/Javascript-ES6/comment.md

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ documentation: ug
88
---
99

1010
# Comment in EJ2 TypeScript Spreadsheet control
11+
The **Comment** feature allows you to add feedback to cells without changing their values, enabling contextual discussions through threaded **replies**. Unlike [Notes](./notes), Comment include advanced review tools such as **resolve** and **reopen** to track status, plus an optional **Comments Review Pane** for browsing and managing threads.
1112

12-
The **Comment** feature allows you to add remarks and **replies** to cells, making it easier to provide feedback or enabling contextual discussions without altering cell values. Comment are distinct from **Notes** and includes advanced capabilities such as replies, resolve/reopen, and an optional **Comments Review Pane** to maintain clear communication and streamline review workflows. When a cell contains a comment, a small comment indicator appears in its corner. Hover over the indicator to preview the comment.
13+
Cells with comment display a small comment indicator; hover to preview the comment editor. This provides a clear, collaborative workflow while keeping data intact.
1314

1415
![Spreadsheet showing a comment](./images/spreadsheet_comment.png)
1516

1617
## Author identity
17-
1818
The Syncfusion Spreadsheet does not automatically track user identity. To tag new comments and replies with an author name, set the `author` property when initializing the Spreadsheet.
1919

2020
```ts
21-
2221
import { Spreadsheet } from '@syncfusion/ej2-spreadsheet';
2322
// Initialize Spreadsheet component
2423
const spreadsheet: Spreadsheet = new Spreadsheet(
@@ -27,139 +26,147 @@ The Syncfusion Spreadsheet does not automatically track user identity. To tag ne
2726
);
2827
// Render initialized Spreadsheet
2928
spreadsheet.appendTo('#element');
30-
3129
```
32-
If the author property is not set, Guest User will be displayed as the author for comment and replies by default.
30+
>If the author property is not set, "Guest User" will be displayed as the author for comment and replies by default.
3331
3432
## Adding a comment
35-
36-
You can add a **comment** to a cell in the following ways:
37-
* **Context menu**: Right-click the target cell and click **"New Comment"**.
38-
* **Ribbon**: Use **Review > Comment > New Comment**.
39-
* **Keyboard shortcut**: Press **Ctrl + Shift + F2** to open the comment container.
33+
You can add a **comment** to a cell in several ways:
34+
* **Context menu**: Right-click the target cell and select **"New Comment"**.
35+
* **Ribbon**: Go to **Review > Comment > New Comment**.
36+
* **Keyboard shortcut**: Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>F2</kbd> to open the comment editor for the active cell.
4037
* **Programmatically**:
4138
* Use the `updateCell` method with the comment model to add a comment to a specific cell.
42-
* Integrate comments during initial loading by binding the comment model to the cell model when initializing the spreadsheet.
39+
* Bind comments via code-behind during initial load by associating the comment model with the cell model.
4340

44-
![Adding a comment in Spreadsheet](./images/spreadsheet_adding_a_comment.gif)
41+
The image below shows that once a comment is posted, the cell displays an indicator, and the comment can be previewed on hover.
4542

46-
After posting, the comment becomes visible with the comment indicator in the cell and can be previewed on hover.
43+
![Adding a comment in Spreadsheet](./images/spreadsheet_adding_a_comment.gif)
4744

4845
## Adding a reply
49-
5046
You can add one or more replies to an existing comment to provide additional details or answers:
51-
5247
* **Context menu**: Right-click the cell that already has a comment, select **Comment > New Reply**, enter your reply, and click **Post**.
53-
* **Ribbon**: Use **Review > Comment > New Comment** on a cell that contains a comment. This triggers **reply mode**.
54-
* **Comment container**: Open the comment container by hovering over the comment indicator, type your reply in the input box, and click **Post**.
55-
* **Keyboard shortcut**: Press **Ctrl + Shift + F2** on a cell that contains a comment to open the comment container in reply mode.
48+
* **Ribbon**: Go to **Review > Comment > New Comment** on a cell that contains a comment. This opens the comment editor in **reply mode**.
49+
* **Comment editor**: Open the comment editor by hovering over the comment indicator, type your reply, and click **Post**.
50+
* **Keyboard shortcut**: Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>F2</kbd> on a cell that contains a comment to open the comment editor in reply mode.
5651

57-
After posting, the replies appear under the initial comment in the container.
52+
After posting, the replies appear under the first comment in the comment editor.
5853

59-
## Editing a comment or reply
54+
![Adding a reply in Spreadsheet](./images/spreadsheet_comment_reply.png)
6055

61-
You can edit the content of a comment or its replies directly within the comment container
56+
## Editing a comment
57+
You can edit the content of a comment or its replies directly within the comment editor.
6258

63-
* **Edit initial comment**: In the comment container. Click the ** (More thread actions)** menu in the header, select **Edit Comment**, modify the text and click **Post**.
64-
* **Edit a reply comment**: In the comment container, hover over the specific reply, click the ** (More actions)**, select **Edit Comment**, update the text and click **Post**.
59+
* **Edit first comment**: In the comment editor. Click the **"⋯" (More thread actions)** menu in the header, select the **Edit Comment**, modify the text and click **Post**.
60+
* **Edit a reply comment**: In the comment editor, hover over the specific reply, click the **"⋯" (More actions)**, select the **Edit Comment**, modify the text and click **Post**.
6561

6662
![Editing a comment reply in Spreadsheet](./images/spreadsheet_edit_comment.png)
6763

6864
## Resolve and Reopen
69-
7065
The **Resolve thread** option marks a comment thread as completed when the discussion or issue is addressed. When a thread is resolved, its background color changes to indicate the resolved state, and the reply input box and reply menu actions are hidden. Use **Reopen** to restore the comment if further discussion is needed.
7166

7267
### Resolve a comment
73-
* In the comment container, click the ** (More thread actions)** menu in the container header and select **Resolve Thread**.
68+
* In the comment editor, click the **"⋯" (More thread actions)** menu in the header and select **Resolve Thread**.
7469

7570
### Reopen a comment
76-
* In the comment container, click the **Reopen** button in the container header to make the thread active again.
71+
* In the comment editor, click the **Reopen** button in the header to make the thread active again.
7772

7873
![Resolve and reopen in Spreadsheet](./images/spreadsheet_resolve_reopen.gif)
7974

8075
You can also use the `isResolved` property in the comment model when initializing or updating comments programmatically.
8176

77+
**Example: Using `isResolved` property in the comment model with the `updateCell` method**
78+
79+
```ts
80+
// Update a cell with a comment using the updateCell method
81+
spreadsheet.updateCell({
82+
comment: {
83+
author: 'Chistoper', text: 'Are you completed the report',
84+
createdTime: 'January 03, 2026 at 5:00 PM',
85+
// Set to true to mark the thread as resolved; false keeps it active
86+
isResolved: false,
87+
replies: [{ author: 'John', text: 'Yes, completed',
88+
createdTime: 'January 03, 2026 at 7:00 PM' }]
89+
}
90+
}, 'Sheet1!D5');
91+
92+
```
93+
8294
## Deleting a comment or reply
8395
You can delete either a specific reply or an entire comment thread (including all replies) using the following options:
8496

8597
### Deleting a comment thread
8698
* **Context menu**: Right-click the cell that contains the comment and select **Comment > Delete Comment**.
87-
* **Ribbon**: Use **Review > Comment > Delete Comment** on a cell that contains the comment.
88-
* **Comment container**: In the comment container, click the **⋯ (More thread actions)** menu in the header and select **Delete Thread** for an active comment or use the **Delete Thread** button in container header for a resolved comment.
89-
90-
![Deleting a comment thread in Spreadsheet](./images/spreadsheet_delete_comment.png)
99+
* **Ribbon**: Go to **Review > Comment > Delete Comment** on a cell that contains the comment.
100+
* **Comment editor**: In the comment editor, click the **"⋯" (More thread actions)** menu in the header and select **Delete Thread** for an active comment or use the **Delete Thread** button in header for a resolved comment.
91101

92102
Deleting a thread removes the comment and all its replies from the cell.
93103

104+
![Deleting a comment thread in Spreadsheet](./images/spreadsheet_delete_comment.png)
105+
94106
### Delete a reply
95-
In the comment container, hover over the reply and click the ** (More actions)** menu then select **Delete Comment**.
107+
In the comment editor, hover over the reply and click the **"⋯" (More actions)** menu then select **Delete Comment**.
96108

97109
![Deleting a comment reply in Spreadsheet](./images/spreadsheet_delete-reply_comment.png)
98110

99111
## Next and Previous Comment
100-
101-
The **Review > Comment > Next Comment and Previous Comment** options in the ribbon allows you to quickly navigate between cells that contain comments:
112+
The **Review > Comment > Next Comment and Previous Comment** options in the ribbon allow you to quickly navigate between cells that contain comments:
102113

103114
* **Next Comment**: Moves to the next cell with a comment.
104115
* **Previous Comment**: Moves to the previous cell with a comment.
105116

106117
Navigation starts within the active sheet. When all comments in the active sheet have been visited (end or start reached), the navigation automatically continues to the next or previous sheet that contains comments. This ensures you can review all comments across the workbook without manually switching sheets.
107118

108-
## Show Comments and Comments Review Pane
119+
![Next and Previous comments in Spreadsheet](./images/spreadsheet_next_previous_comment.png)
109120

110-
The **Comments Review Pane** provides a centralized view of all comments in the active sheet and offers filtering, inline actions, and navigation. This pane helps you to manage comments efficiently without switching between individual cells.
121+
## Comments review pane
122+
The **"Comments" review pane** provides a centralized view of all comments in the active sheet, making it easier to manage discussions without switching between individual cells. It offers filtering, inline actions, and navigation, ensuring an efficient review workflow across the workbook.
111123

112-
You can show or hide the Comments Review Pane using:
124+
You can show or hide the "Comments" review pane using:
113125

114-
* **Ribbon**: Use **Review > Comment > Show Comments**.
115-
* **Property**: Set the `showCommentsPane` property when initializing the Spreadsheet. The default value for the `showCommentsPane` property is `false`.
126+
* **Ribbon**: Go to **Review > Comment > Show Comments**.
127+
* **Property**: Set the `showCommentsPane` property to true when initializing the Spreadsheet. By default, this property is **false**.
116128

117129
![Show comments in Spreadsheet](./images/spreadsheet_show_comments.gif)
118130

119-
### Features of the Comments Review Pane
131+
### Features of the comments review pane
132+
The "Comments" review pane is rendered within the spreadsheet interface to provide a dedicated space for managing comments efficiently. It acts as a centralized hub where you can view all comment threads, perform actions, and keep discussions organized without navigating cell by cell.
120133

121-
The Comments Review Pane allows you to:
134+
The "Comments" review pane allows you to:
122135

123-
* **Add new comment** using the **New** button.
124-
* **Filter comments** by **All**, **Active**, or **Resolved** to focus on specific comments.
125-
* **Navigate between comments** and synchronize selection with the corresponding cells.
136+
* Add new comment using the **New** button.
137+
* Filter comments by **All**, **Active**, or **Resolved** to view specific comment threads.
138+
* Navigate between comments and synchronize selection with the corresponding cells.
126139
* Perform actions such as:
127-
* **Reply** – Add replies directly from the pane.
140+
* **Reply** – Add replies directly from the review pane.
128141
* **Edit** – Modify the text of a comment or reply.
129142
* **Delete** – Remove a reply or an entire thread.
130143
* **Resolve/Reopen** – Change the status of a comment.
131144

132-
When the Review Pane is open, all actions performed in the comments review pane or in the cell’s comment container are synchronized:
145+
When the review pane is open, all actions performed in the review pane or in the cell’s comment editor are synchronized:
133146

134-
* Selecting a comment in the Comments Review Pane highlights the corresponding cell in the sheet.
135-
* Selecting a cell with a comment focuses the respective comment thread in the Comments Review Pane.
136-
* Actions such as **Reply**, **Edit**, **Delete**, and **Resolve/Reopen** update both the pane comment thread and the cell comment container instantly, ensuring consistency across the UI.
147+
* Selecting a comment in the review pane highlights the corresponding cell in the sheet.
148+
* Selecting a cell with a comment focuses the respective comment thread in the review pane.
149+
* Actions such as **Reply**, **Edit**, **Delete**, and **Resolve/Reopen** update both the pane and the cell comment editor instantly, ensuring consistency across the UI.
150+
* The review pane dynamically updates when comments are added, deleted, or resolved, so you always see the latest state without refreshing.
137151

138152
## Saving a Workbook with Comments
139-
140153
You can save spreadsheet data along with **comments** using **File > Save As > Microsoft Excel(.xlsx)**.
141154
- **MS Excel (.xlsx)** - Preserves all **threaded comments** (modern comments).
142155

143156
> Comments are **not included** when exporting to **.xls**, **.csv**, and **.pdf**.
144157
145-
### Why Comments Are Not Saved in `.xls`
158+
### Why comments are not saved in `.xls`
146159
The **.xls** format is based on the older Excel binary structure (BIFF8), which does not support modern features like **threaded comments**.
147160
Threaded comments introduced in newer Excel versions require the **Open XML** structure used by `.xlsx`.
148161

149162
> To retain threaded comments, always save the workbook in **.xlsx** format.
150163
151-
## Integrating comments during initial loading using cell data binding
152-
164+
## Bind Comments via code-behind
153165
You can bind **comment thread** to cells at initial load by providing a `comment` object in the cell model. Each cell supports **per comment thread**, which can include:
154-
- **Initial comment fields**: `author`, `text`, `createdTime`, `isResolved`
166+
- **Comment**: `author`, `text`, `createdTime`, `isResolved`
155167
- **Replies**: A collection of replies. Each reply is an object containing its `author`, `text`, and `createdTime` (no nested replies-of-replies).
156168

157-
When the workbook renders, cells that include a `comment`:
158-
- Show the **comment indicator** in the cell corner.
159-
- Open the **comment container** on hover.
160-
- Appear in the **Comments Review Pane** if it is shown.
161-
162-
In the below sample, comments are added to a specific cell using cell data binding. The review pane is shown initially by enabling the `showCommentsPane` property, and comments are added using `updateCell` method in the `created` event.
169+
In the below sample, comments are added to a specific cell using cell data binding. The "Comments" review pane is shown initially by enabling the `showCommentsPane` property, and comments are added using `updateCell` method in the `created` event.
163170

164171
{% tabs %}
165172
{% highlight ts tabtitle="index.ts" %}
@@ -172,20 +179,17 @@ In the below sample, comments are added to a specific cell using cell data bindi
172179

173180
{% previewsample "/document-processing/code-snippet/spreadsheet/javascript-es6/comemnt-cs1" %}
174181

175-
### Notes
176-
182+
### Important Notes
177183
* **One thread per cell**: Attach a single `comment` object per cell. New remarks should be added as replies inside the existing thread.
178-
* **Comments and Notes cannot coexist**: When a cell contains comment, notes cannot be added. Similarly, if a cell already has a notes, comment cannot be added.
179-
* **New comment**: When the Comments Review Pane is enabled, adding a new comment renders the drafted comment container directly in the Comments Review Pane.
180-
* **Comments in Print**: Comments are not included in print output.
181184
* **Author Identity**: The author name for each comment and reply is static once set. When exporting, the author information is preserved for all comments, even if multiple authors exist in the workbook.
185+
* **New comment**: When the "Comments" review pane is enabled, adding a new comment renders the drafted comment editor directly in the "Comments" review pane.
182186

183187
## Limitations
184-
185-
* **Un-posted comment is not stored**: If you type in the comment container and close it without clicking **Post**, the entered text is not saved and does not retain in the input box when you reopen the container. Only posted content is persisted in the comment model.
188+
* **Un-posted comments are not stored**: If you type in the comment editor and close it without clicking **Post**, the entered text is not saved and will not appear when you reopen the editor. Only posted content is persisted in the comment model.
189+
* **Comments and Notes cannot coexist**: When a cell contains comment, notes cannot be added. Similarly, if a cell already has a notes, comment cannot be added.
190+
* **Comments in Print**: Comments are not included in print output.
186191
* **Non-collaborative**: Real-time multi-user synchronization is not supported. However, when exporting and re-importing the workbook, the author information for each comment and reply is preserved.
187192

188193
## See Also
189-
190194
* [Notes](./notes)
191195
* [Hyperlink](./link)
87.3 KB
Loading
82.4 KB
Loading

Document-Processing/Excel/Spreadsheet/Javascript-ES6/keyboard-shortcuts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The keyboard shortcuts supported in the spreadsheet are,
107107
| Shift + Enter | Complete the cell editing and select the cell above in the same column. |
108108
| Tab | Complete the cell editing and select the next cell in the same row. |
109109
| Shift + Tab | Complete the cell editing and select the previous cell in the same row. |
110-
| Ctrl + Shift + F2 | Open the threaded comment container for the desired cells. Upon pressing the `Esc` key, the comment container in focus will close. |
110+
| Ctrl + Shift + F2 | Opens the comment editor for the active cell. Upon pressing the `Esc` key, the comment editor in focus will close. |
111111
| Shift + F2 | Open the dialog box to add or edit notes for the desired cells. Meanwhile, upon pressing the `Esc` key, the dialog box for notes, when in focus, will save and close. |
112112
| Alt | Focus on the active ribbon tab. |
113113
| Left | Move the focus to the previous items in the ribbon content. |

0 commit comments

Comments
 (0)