Spread for ASP.NET 9.0 Product Documentation
SaveOrLoadSheetState Event
Example 


Occurs when the user saves or loads a view state of a sheet.
Syntax
'Declaration
 
Public Event SaveOrLoadSheetState As SheetViewStateEventHandler
'Usage
 
Dim instance As FpSpread
Dim handler As SheetViewStateEventHandler
 
AddHandler instance.SaveOrLoadSheetState, handler
public event SheetViewStateEventHandler SaveOrLoadSheetState
Event Data

The event handler receives an argument of type SheetViewStateEventArgs containing data related to this event. The following SheetViewStateEventArgs properties provide information specific to this event.

PropertyDescription
HandledGets or sets whether the event has been handled.  
IndexGets the index of the collection that contains the sheet.  
IsSaveGets whether the state of the sheet is saved.  
SheetViewGets the sheet whose state is to be loaded or to be saved.  
Remarks
When the SaveViewStateToSession property is true, spread saves its view state to the Session object. If you do not want to save the spread view state to the Session object, you should set this property to false. The default value is true.
Example
This example illustrates the use of the event.
private void FpSpread1SaveOrLoadSheetState(object sender, FarPoint.Web.Spread.SheetViewStateEventArgs e)  
{
    if (e.IsSave)
    { 
        Session["SheetName" + e.Index] = e.SheetView.SaveViewState();
    } 
    else
    { 
        e.SheetView.LoadViewState(Session["SheetName" + e.Index]); 
    }
    e.Handled = true; 
}
Private Sub FpSpread1SaveOrLoadSheetState(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.SheetViewStateEventArgs)
Handles FpSpread1.SaveOrLoadSheetState 
    If (e.IsSave) Then 
        Session("SheetName" & e.Index) = e.SheetView.SaveViewState() 
    Else 
        e.SheetView.LoadViewState(Session("SheetName" & e.Index)) 
    End If 
    e.Handled = True 
End Sub 
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

FpSpread Class
FpSpread Members
SaveViewStateToSession Property

 

 


Copyright © GrapeCity, inc. All rights reserved.