Spread ASP.NET 6.0 Product Documentation
RemoveRows(Int32,Int32) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class : RemoveRows(Int32,Int32) Method


row
Index of first row to remove
count
Number of rows to remove

Glossary Item Box

Removes one or more rows, starting with the specified row.

Syntax

Visual Basic (Declaration) 
Public Sub RemoveRows( _
   ByVal row As Integer, _
   ByVal count As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim row As Integer
Dim count As Integer
 
instance.RemoveRows(row, count)
C# 
public void RemoveRows( 
   int row,
   int count
)

Parameters

row
Index of first row to remove
count
Number of rows to remove

Exceptions

ExceptionDescription
System.ArgumentOutOfRangeException Specified row is out of range; must be between 0 and total number of rows
System.ArgumentOutOfRangeException Specified number of rows is out of range; must be between 1 and total number of rows beyond the specified starting row

Example

This example creates a new DefaultSheetDataModel, sets its number of rows and columns in the constructor and attaches it to the DataModel of the active sheet. Data is added to some cells in the first three columns. In a button click event the RemoveRows method removes the first two rows.
Visual BasicCopy Code
PrivatevoidPage_Load(objectsender,System.EventArgse)
{
If(this.IsPostBack)Return;

FarPoint.Web.Spread.Model.DefaultSheetDataModeldm=NewFarPoint.Web.Spread.Model.DefaultSheetDataModel(8,8);
FpSpread1.ActiveSheetView.DataModel=dm;
FpSpread1.ActiveSheetView.SetValue(0,0,"First");
FpSpread1.ActiveSheetView.SetValue(1,0,"Second");
FpSpread1.ActiveSheetView.SetValue(2,0,"Third");
}

PrivatevoidButton1_Click(objectsender,System.EventArgse)
{
FarPoint.Web.Spread.Model.DefaultSheetDataModeldm=(FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
dm.RemoveRows(0,2);
}
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(Me.IsPostBack)ThenReturn

DimdmAsNewFarPoint.Web.Spread.Model.DefaultSheetDataModel(8,8)
FpSpread1.ActiveSheetView.DataModel=dm
FpSpread1.ActiveSheetView.SetValue(0,0,"First")
FpSpread1.ActiveSheetView.SetValue(1,0,"Second")
FpSpread1.ActiveSheetView.SetValue(2,0,"Third")
EndSub

PrivateSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1.Click
DimdmAsFarPoint.Web.Spread.Model.DefaultSheetDataModel=FpSpread1.ActiveSheetView.DataModel
dm.RemoveRows(0,2)
EndSub

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.