إدارة التعليقات في ورقة العمل

التعامل مع التعليقات

إضافة التعليقات

لإضافة تعليق إلى ورقة العمل ، يرجى اتباع الخطوات التالية:

  1. قم بإضافة عنصر تحكم Aspose.Cells.GridWeb إلى نموذج ويب.
  2. قم بالوصول إلى ورقة العمل التي تضيف تعليقات إليها.
  3. أضف تعليقًا إلى خلية.
  4. ضع ملاحظة للتعليق الجديد.

تمت إضافة تعليق إلى ورقة العمل

ما يجب القيام به: image_بديل_نص

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the reference of the worksheet that is currently active and add a dummy value to cell A1
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];
sheet.Cells["A1"].PutValue("This cell has a comment added, hover to view.");
// Resize first column
sheet.Cells.SetColumnWidth(0, 140);
// Adding comment to "A1" cell of the worksheet
GridComment comment = sheet.Comments[sheet.Comments.Add("A1")];
// Setting the comment note
comment.Note = "These are my comments for the cell";

الوصول إلى التعليقات

للوصول إلى تعليق:

  1. قم بالوصول إلى الخلية التي تحتوي على التعليق.
  2. احصل على مرجع الخلية.
  3. قم بتمرير المرجع إلى مجموعة التعليقات للوصول إلى التعليق.
  4. من الممكن الآن تعديل خصائص التعليق.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// 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.";
}

إزالة التعليقات

لإزالة تعليق:

  1. قم بالوصول إلى الخلية كما هو موضح أعلاه.
  2. استخدم طريقة RemoveAt الخاصة بمجموعة التعليقات لإزالة التعليق.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// 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"];
// Removing comment from the specific cell
sheet.Comments.RemoveAt(cell.Name);