Table of Contents

XlsFile.CommentCountRow Method

Number of comments on a given row.

Remarks

There are 2 groups of Comment related methods. One is used when you want to find out on a loop all existing comments on a range, and the other is used to get/set comments at a specified position (row and col). To loop among all existing comments, you can use ExcelFile.CommentRowCount together with CommentCountRow. Do not confuse them, even when they have similar names. ExcelFile.CommentRowCount returns the maximum row with a comment, and CommentCountRow returns the number of comments in a given row.

Syntax

Namespace: FlexCel.XlsAdapter

public override Int32 CommentCountRow(Int32 row)

Parameters

<-> Parameter Type Description
row Int32 Row index (1 based)

Returns

The number of comments on a given row.

Examples

You can loop on all the comments on a sheet with the following code:

    for (int row = 1; row <= xls.CommentRowCount(); row++)
    {
        for (int commentIndex = 1; commentIndex <= xls.CommentCountRow(row); commentIndex++)
        {
            DoSomething(xls.GetCommentRow(row, commentIndex));
        }
    }

See also