إضافة أو إدراج ورقة عمل

إضافة ورقة عمل

لإضافة ورقة عمل باستخدام Aspose.Cells.GridDesktop، يُرجى اتباع الخطوات التالية:

  1. أضف تحكم Aspose.Cells.GridDesktop إلى نموذج.
  2. استدعاء طريقة Add في مجموعة الورقات في تحكم GridDesktop.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Adding a worksheet to the Grid
int i = gridDesktop1.Worksheets.Add();
Worksheet sheet = gridDesktop1.Worksheets[i];

تتوفر العديد من الإصدارات المتحملة لطريقة Add. باستخدام الإصدار المتحمل أعلاه، على سبيل المثال، يتم إضافة ورقة عمل إلى ملف Excel باسم ورقة افتراضي. باستخدام إصدارات أخرى من طريقة Add، من الممكن تعريف الاسم كما هو موضح أدناه في المثال.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Adding a worksheet to the Grid with a specific name
Worksheet sheet1 = gridDesktop1.Worksheets.Add("AddWorksheetWithName");

إدراج ورقة عمل

لإدراج ورقة عمل باستخدام Aspose.Cells.GridDesktop، يرجى اتباع الخطوات التالية:

  1. أضف تحكم Aspose.Cells.GridDesktop إلى نموذج.
  2. استدعاء طريقة الإدراج في مجموعة الأوراق داخل عنصر التحكم GridDesktop.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Inserting a worksheet to Grid at first position of the worksheets collection
gridDesktop1.Worksheets.Insert(0);