SPREAD for ASP.NET 10.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>