Spread for ASP.NET 7.0 Product Documentation
Reset Method
See Also  Example Support Options
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
private void Page_Load(object sender,System.EventArgs e)
{
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;
}

private void Button1_Click(object sender,System.EventArgs e)
{
FpSpread1.Reset();
}
Visual BasicCopy Code
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load

If(Me.IsPostBack)Then 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
End Sub

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Button1.Click
FpSpread1.Reset()
End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.