Spread for ASP.NET 11 Product Documentation
Removing a Row or Column
Spread for ASP.NET 11 Product Documentation > Developer's Guide > Customizing the Appearance > Customizing the Appearance of Rows and Columns > Removing a Row or Column

You can remove one or more rows or columns from a sheet and you can allow the end user to remove rows or prohibit them from removing rows.

If you simply want to hide the row or column from the end user, but not remove it from the sheet, refer to Showing or Hiding Rows or Columns.

Using a Shortcut

  1. Use the RemoveRows or RemoveColumns method for the Sheets shortcut.
  2. Set the row or column parameter to specify the first row or column to remove.
  3. Set the count parameter to specify the number of rows or columns to remove.

Example

This example code removes two rows.

C#
Copy Code
FpSpread1.Sheets[0].RemoveRows(6,2); 
VB
Copy Code
FpSpread1.Sheets(0).RemoveRows(6,2) 

Using Code

  1. Use the RemoveRows or RemoveColumns method for a SheetView object.
  2. Set the row or column parameter to specify the first row or column to remove.
  3. Set the count parameter to specify the number of rows or columns to remove.

Example

This example code removes two rows.

C#
Copy Code
FarPoint.Web.Spread.SheetView Sheet0;
Sheet0 = FpSpread1.Sheets[0];
Sheet0.RemoveRows(6,2); 
VB
Copy Code
Dim Sheet0 As FarPoint.Web.Spread.SheetView
Sheet0 = FpSpread1.Sheets(0)
Sheet0.RemoveRows(6, 2) 

Using the Spread Designer

  1. Select the Data menu.
  2. At the bottom, select the sheet for which you want to remove rows or columns.
  3. In the Rows or Columns area, select an existing row or column in the list.
  4. Click the Delete icon. Select Delete Row or Delete Column to remove a row or column.
  5. Click OK.
  6. Click Apply and Exit to close the Spread Designer.