Spread for ASP.NET 11 Product Documentation
SaveViewState Method (FpSpread)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > FpSpread Class : SaveViewState Method
Saves the view state of the component.
Syntax
'Declaration
 
Protected Overrides Function SaveViewState() As Object
'Usage
 
Dim instance As FpSpread
Dim value As Object
 
value = instance.SaveViewState()
protected override object SaveViewState()

Return Value

Object in which to save the view state
Example
This example loads or saves the view state depending on its state.
private void fpSpread1SaveOrLoadSheetState(object sender, FarPoint.Web.Spread.SheetViewStateEventArgs e) 
{ 
if (e.IsSave) 
{ 
     Session["Sheets" + e.Index] = e.SheetView.SaveViewState(); 
} 
else 
{ 
     object o = Session["Sheets" + e.Index]; 
     object temp = null; 
     if (!(object.ReferenceEquals(o,temp))) 
     { 
          e.SheetView.LoadViewState(o); 
     } 
} 
e.Handled = true;  
} 
Private Sub fpSpread1SaveOrLoadSheetState(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.SheetViewStateEventArgs)
If e.IsSave Then
     Session(("Sheets" + e.Index)) = e.SheetView.SaveViewState()
Else
     Dim o As Object = Session(("Sheets" + e.Index))
     Dim temp As Object = Nothing
     If Not Object.ReferenceEquals(o, temp) Then
         e.SheetView.LoadViewState(o)
     End If
End If 
e.Handled = True
End Sub
See Also

Reference

FpSpread Class
FpSpread Members
SheetView.SaveViewState Method