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

إدراج الصفوف

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

  1. أضف عنصر تحكم Aspose.Cells.GridWeb إلى نموذج الويب.
  2. الوصول إلى ورقة العمل التي تقوم بإضافة الصفوف إليها.
  3. إدراج صف عن طريق تحديد فهرس الصف الذي سيتم إدراج الصف فيه.
// 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];
// Get row index entered by user
int rowIndex = Convert.ToInt16(txtRowIndex.Text.Trim());
// Add row at specified index
sheet.Cells.InsertRow(rowIndex);

إدراج الأعمدة

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

  1. أضف تحكم Aspose.Cells.GridWeb إلى استمارة الويب.
  2. الوصول إلى ورقة العمل التي تقوم بإضافة الأعمدة إليها.
  3. إدراج عمود عن طريق تحديد فهرس العمود الذي سيتم إدراج العمود فيه.
// 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];
// Get column index entered by user
int columnIndex = Convert.ToInt16(txtColumnIndex.Text.Trim());
// Add column at specified index
sheet.Cells.InsertColumn(columnIndex);