Occurs when the name of the data model changes.
Syntax
Visual Basic (Declaration) | |
---|
Public Event NameChanged As EventHandler |
Example
This example notifies the user of a change in the name of the model.
C# | Copy Code |
---|
FarPoint.Web.Spread.Model.DefaultSheetDataModel dsdm;
private void PageLoad(object sender, System.EventArgs e)
{
dsdm = (FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
FpSpread1.Tab.TabControlPolicy = FarPoint.Web.Spread.TabControlPolicy.Always;
Response.Write(dsdm.Name);
dsdm.NameChanged += new EventHandler(dsdmNameChanged);
}
private void Button1Click(object sender, System.EventArgs e)
{
FpSpread1.Sheets[0].SheetName = "Test";
}
private void dsdmNameChanged(object sender, EventArgs e)
{
Response.Write("alert('The name of the model has changed!!')");
}
|
Visual Basic | Copy Code |
---|
Friend WithEvents dsdm As FarPoint.Web.Spread.Model.DefaultSheetDataModel
Private Sub PageLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dsdm = FpSpread1.ActiveSheetView.DataModel
ins = dsdm
FpSpread1.Tab.TabControlPolicy = FarPoint.Web.Spread.TabControlPolicy.Always
Response.Write(dsdm.Name)
End Sub
Private Sub Button1Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FpSpread1.Sheets(0).SheetName = "Test"
End Sub
Private Sub dsdmNameChanged(ByVal sender As Object, ByVal e As EventArgs) Handles dsdm.NameChanged
Response.Write("alert('The name of the model has changed!!')")
End Sub |
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