行と列の削除

行の削除

ワークシートから行を削除するには:

  1. Web フォームに 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. Web フォームに 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);