SPREAD for ASP.NET 10.0J サンプルコード集 > セル型 > チェックボックス型セル > コードでチェックボックスをチェックする |
CellクラスのValueプロパティに、チェックボックスの値を設定します。
CheckBoxCellType checkCell = new CheckBoxCellType(); FpSpread1.Cells[0, 1].CellType = checkCell; //チェックボックス型セルに値を設定します FpSpread1.Cells[0, 1].Value = true;
Dim checkCell As New CheckBoxCellType() FpSpread1.Cells(0, 1).CellType = checkCell 'チェックボックス型セルに値を設定します FpSpread1.Cells(0, 1).Value = True
クライアント側で処理することもできます。
CheckBoxCellType checkCell = new CheckBoxCellType();
FpSpread1.Cells[0, 1].CellType = checkCell;
Dim checkCell As New CheckBoxCellType() FpSpread1.Cells(0, 1).CellType = checkCell
<script type="text/javascript"> window.onload = function () { var spread = document.getElementById("FpSpread1"); spread.SetValue(0, 1, true); } </script>