SPREAD for ASP.NET 8.0J サンプルコード集 > セル型 > コンボボックス型セル > 項目選択をクライアント側で処理する |
コンボボックス型セルのOnClientChangedプロパティに、項目が選択されたときのクライアント側処理を記述します。
ComboBoxCellType cbCell = new ComboBoxCellType() { Items = new string[] { "要素1", "要素2", "要素3" }, OnClientChanged = "onMyComboChanged();" }; FpSpread1.Cells[0, 1].CellType = cbCell;
Dim cbCell As New ComboBoxCellType() With { .Items = New String() {"要素1", "要素2", "要素3"}, .OnClientChanged = "onMyComboChanged();" } FpSpread1.Cells(0, 1).CellType = cbCell
<!--JavaScriptで項目が選択されたときの処理を記述します--> <script type="text/javascript"> function onMyComboChanged() { var spread = document.getElementById("FpSpread1"); alert("セルの値:" + spread.GetValue(spread.ActiveRow, spread.ActiveCol)); } </script>