spreadsheet ,How do I use code to insert comments

1 Answer 179 Views
Spreadsheet wrapper
Top achievements
Rank 1
Iron
asked on 16 Feb 2022, 01:24 AM
How do I use code to insert comments 

1 Answer, 1 is accepted

Sort by
0
Accepted
Petar
Telerik team
answered on 16 Feb 2022, 08:49 AM

Hi, 三,

You can programmatically add comments to the Spreadsheet cells using the comment method

Here is a StackBlitz example demonstrating the usage of the mentioned method.

I hope the above example will help you achieve what you need in your application.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Top achievements
Rank 1
Iron
commented on 02 Mar 2022, 10:53 AM

Thank you very much for your answer. Based on this question, is there any way we can get the comments in the designated cell?
Petar
Telerik team
commented on 02 Mar 2022, 03:16 PM

Hi, 三.

You can use the same comment method to get the value of a given cell. Here is a modified version of the previous example I sent you. In it, I've added the below lines. 

console.log(sheet.range('A1').comment());
console.log(sheet.range('B2').comment());

If you run the linked project and check the browser's console, you will see the comments of cells A1 and B2.

Tags
Spreadsheet wrapper
Asked by
Top achievements
Rank 1
Iron
Answers by
Petar
Telerik team
Share this question
or