Spread ASP.NET 6.0 Product Documentation
ClearFormulas Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class : ClearFormulas Method


row
Row index of start of range to clear
column
Column index of start of range to clear
rowCount
Number of rows to clear
columnCount
Number of columns to clear

Glossary Item Box

Removes all of the formulas from the specified range of cells.

Syntax

Visual Basic (Declaration) 
Public Overridable Sub ClearFormulas( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
 
instance.ClearFormulas(row, column, rowCount, columnCount)
C# 
public virtual void ClearFormulas( 
   int row,
   int column,
   int rowCount,
   int columnCount
)

Parameters

row
Row index of start of range to clear
column
Column index of start of range to clear
rowCount
Number of rows to clear
columnCount
Number of columns to clear

Remarks

For a list of the operators and functions you can use in formulas, refer to the Spread for .NET Formula Reference.

Example

This example adds data to the first three columns along with formulas to sum the values. In the click event of a button the formulas are cleared from the cells. Note, however, that the data in the cells that contained the formulas remains.
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(Me.IsPostBack)ThenReturn

FpSpread1.ActiveSheetView.RowCount=10
DimiAsInteger
Fori=0To3
FpSpread1.ActiveSheetView.SetValue(i,0,i)
FpSpread1.ActiveSheetView.SetValue(i,1,i)
FpSpread1.ActiveSheetView.SetValue(i,2,i)
Next

FpSpread1.ActiveSheetView.Cells(5,0).Formula="SUM(A3:A4)"
FpSpread1.ActiveSheetView.Cells(5,1).Formula="SUM(A3:A4)"
FpSpread1.ActiveSheetView.Cells(5,2).Formula="SUM(A3:A4)"

EndSub

PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
DimdmAsFarPoint.Web.Spread.Model.DefaultSheetDataModel=CType(FpSpread1.ActiveSheetView.DataModel,FarPoint.Web.Spread.Model.DefaultSheetDataModel)
dm.ClearFormulas(5,0,1,3)
EndSub
C#Copy Code
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;

FpSpread1.ActiveSheetView.RowCount=10;
for(inti=0;i<10;i++)
{
FpSpread1.ActiveSheetView.SetValue(i,0,i);
FpSpread1.ActiveSheetView.SetValue(i,1,i);
FpSpread1.ActiveSheetView.SetValue(i,2,i);
}

FpSpread1.ActiveSheetView.Cells[5,0].Formula="SUM(A3:A4)";
FpSpread1.ActiveSheetView.Cells[5,1].Formula="SUM(A3:A4)";
FpSpread1.ActiveSheetView.Cells[5,2].Formula="SUM(A3:A4)";
}

privatevoidButton1_Click(objectsender,System.EventArgse)
{
FarPoint.Web.Spread.Model.DefaultSheetDataModeldm=(FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
dm.ClearFormulas(5,0,1,3);
}

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.