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


Glossary Item Box

Resets the Spread component to its default values, removing all settings and all sheets.

Syntax

Visual Basic (Declaration) 
Public Sub Reset() 
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
 
instance.Reset()
C# 
public void Reset()

Remarks

This method returns the component to the state as if the Spread object was just created with the default constructor. That default Spread object has no sheets in the component and no appearance settings set.

It resets the Sheets and the NamedStyles collections to their default values.

Caution: If you use the Reset method, everything in your component is deleted, including data, style settings, and sheets.

Example

This example creates a spreadsheet with three sheets, changes the name of the sheets, and sets the backcolor of the first cell on each one. In a button click event, the spreadsheet is reset to its original settings.
C#Copy Code
PrivatevoidPage_Load(objectsender,System.EventArgse)
{
If(this.IsPostBack)Return;

FpSpread1.Sheets.Count=3;
FpSpread1.Sheets[0].SheetName="One";
FpSpread1.Sheets[1].SheetName="Two";
FpSpread1.Sheets[2].SheetName="Three";
FpSpread1.Sheets[0].Cells[0,0].BackColor=Color.Yellow;
FpSpread1.Sheets[1].Cells[0,0].BackColor=Color.Yellow;
FpSpread1.Sheets[2].Cells[0,0].BackColor=Color.Yellow;

}

PrivatevoidButton1_Click(objectsender,System.EventArgse)
{
FpSpread1.Reset();
}
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(Me.IsPostBack)ThenReturn

FpSpread1.Sheets.Count=3
FpSpread1.Sheets(0).SheetName="One"
FpSpread1.Sheets(1).SheetName="Two"
FpSpread1.Sheets(2).SheetName="Three"
FpSpread1.Sheets(0).Cells(0,0).BackColor=Color.Yellow
FpSpread1.Sheets(1).Cells(0,0).BackColor=Color.Yellow
FpSpread1.Sheets(2).Cells(0,0).BackColor=Color.Yellow

EndSub

PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
FpSpread1.Reset()
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.