Aspose.Cells.GridWeb.Examples.CSharp.Worksheets.ManageComments.btnUpdateComments_Click C# (CSharp) Method

btnUpdateComments_Click() protected method

protected btnUpdateComments_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        protected void btnUpdateComments_Click(object sender, EventArgs e)
        {
            // ExStart:AccessComments
            // Accessing the reference of the worksheet that is currently active
            GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            // Accessing a specific cell that contains comment
            GridCell cell = sheet.Cells["A1"];

            // Accessing the comment from the specific cell
            GridComment comment = sheet.Comments[cell.Name];

            if (comment != null)
            {
                // Modifying the comment note
                comment.Note = "I have modified the comment note.";
            }
            // ExEnd:AccessComments
        }