Удаление строк и столбцов

Удаление строк

Чтобы удалить строку из вашего листа:

  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);