Insertar filas y columnas

Insertar filas

Para insertar una fila en cualquier posición de una hoja de cálculo:

  1. Agregue el control Aspose.Cells.GridWeb al formulario web.
  2. Acceda a la hoja de trabajo a la que está agregando filas.
  3. Inserte una fila especificando un índice de fila donde se insertaría la fila.
// 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);

Insertar columnas

Para insertar una columna en cualquier posición de una hoja de cálculo:

  1. Agregue el control Aspose.Cells.GridWeb a un formulario web.
  2. Acceda a la hoja de trabajo a la que está agregando columnas.
  3. Inserte una columna especificando el índice de columna donde se insertaría la columna.
// 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);