حذف الصفوف والأعمدة

حذف الصفوف

لحذف صف من ورقة العمل الخاصة بك:

  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());
// Delete row at specified index
sheet.Cells.DeleteRow(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());
// Delete column at specified index
sheet.Cells.DeleteColumn(columnIndex);