officefileapi-devexpress-dot-spreadsheet-dot-threadedcommentcollection-dot-getthreadedcomments-x28-devexpress-dot-spreadsheet-dot-cellrange-x29.md
Retrieves all comments applied to the specified cell range.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
IList<ThreadedComment> GetThreadedComments(
CellRange range
)
Function GetThreadedComments(
range As CellRange
) As IList(Of ThreadedComment)
| Name | Type | Description |
|---|---|---|
| range | CellRange |
A cell range that contains comments that should be returned.
|
| Type | Description |
|---|---|
| IList<ThreadedComment> |
A collection of threaded comments within the specified range of cells.
|
The GetThreadedComments method returns all threaded comments contained in cell ranges that intersect the specified cell range. To check whether a comment is contained in the worksheet, use the ThreadedCommentCollection.Contains method.
The code sample below obtains all comments added to the A1:G20 cell range:
using DevExpress.Spreadsheet;
var workbook = new Workbook();
workbook.LoadDocument(@"C:\Docs\Comments.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
var comments = worksheet.ThreadedComments.GetThreadedComments(worksheet["A1:G20"]);
Imports DevExpress.Spreadsheet
Private workbook = New Workbook()
workbook.LoadDocument("C:\Docs\Comments.xlsx")
Dim worksheet As Worksheet = workbook.Worksheets(0)
Dim comments = worksheet.ThreadedComments.GetThreadedComments(worksheet("A1:G20"))
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetThreadedComments(CellRange) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-spreadsheetcontrol-api-part1/CS/SpreadsheetControl/SpreadsheetActions/CellActions.cs#L482
// Get the added comment and make it visible.
ThreadedComment commentE2 = worksheet.ThreadedComments.GetThreadedComments(worksheet["E2"])[0];
See Also
ThreadedCommentCollection Interface