SPREAD for ASP.NET 8.0J サンプルコード集
リンクでサブウィンドウを表示する

コマンドボタン型セルのButtonTypeプロパティをLinkButtonに設定し、ボタンのonClientClickイベントにサブウィンドウを表示する処理を記述します。

実行例:

ButtonCellType btnCell = new ButtonCellType()
{
    ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton,
    OnClientClick = "openMyWindow();",
    Text="開く"
               
};
FpSpread1.Cells[0, 1].CellType = btnCell;
Dim btnCell As New ButtonCellType() With { 
    .ButtonType = FarPoint.Web.Spread.ButtonType.LinkButton, 
    .OnClientClick = "openMyWindow();", 
    .Text = "開く"
}
FpSpread1.Cells(0, 1).CellType = btnCell
<!--JavaScriptでサブウィンドウを表示する処理を記述します-->
<script type="text/javascript">
    function openMyWindow() {
        var features = "width=200,height=100";
        window.open("http://www.grapecity.com/tools/", "MyWindow", features);
    }
</script>

 

 


© 2013-2015, GrapeCity inc. All rights reserved.