Version

Adding a Comment to a Cell (Infragistics Excel Engine)

A comment allows you to display hints or notes for a cell when the end user’s mouse hovers over a cell. The comments display as a tooltip-like callout that contains text. The Infragistics Excel Engine allows you to add comments to a cell by setting a WorksheetCell object’s Comment property.

CellComment.png

The following example code demonstrates how to add a comment to a cell. The example code assumes you have a reference to a Worksheet object named worksheet1.

In Visual Basic:

Dim row As WorksheetRow = worksheet1.Rows(6)
row.Cells(0).Comment = New WorksheetCellComment() With { _
    .Text = New FormattedString("Comment for a cell")
}

In C#:

WorksheetRow row = worksheet1.Rows[6];
row.Cells[0].Comment = new WorksheetCellComment
{
    Text = new FormattedString("Comment for a cell")
};