MESCIUS SPREAD for ASP.NET 10.0J
NameChanged イベント (INameSupport)

データモデルの名前が変更されたときに発生します。
構文
'Declaration
 
Event NameChanged As EventHandler
event EventHandler NameChanged
解説
このイベントハンドラは、このイベントに関連するデータを含むEventHandlerタイプの引数を受け取ります。
次のサンプルコードは、モデルの名前が変更されたかどうかをユーザーに知らせます。
FarPoint.Web.Spread.Model.DefaultSheetDataModel dsdm;
FarPoint.Web.Spread.Model.INameSupport ins;

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);
    ins = (FarPoint.Web.Spread.Model.INameSupport)dsdm;
    dsdm.NameChanged += new EventHandler(dsdmNameChanged);
    ins.NameChanged += new EventHandler(insNameChanged);
}

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!!')");
}

private void insNameChanged(object sender, EventArgs e)
{
    Response.Write(ins.Name);
}
Friend WithEvents dsdm As FarPoint.Web.Spread.Model.DefaultSheetDataModel
Friend WithEvents ins As FarPoint.Web.Spread.Model.INameSupport

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"
      Response.Write(ins.Name)
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
参照

INameSupport インタフェース
INameSupport メンバ

 

 


© MESCIUS inc. All rights reserved.