SPREAD for ASP.NET 8.0J サンプルコード集
セルのフォーカス取得を禁止する

Cell、Row、またはColumnクラスのCanFocusプロパティをFalseに設定すると、ユーザーが、キーボード入力やマウス操作でセル、行、または列にフォーカスを移動できないようにできます。

実行例:

フォーカスはCell[0, 0]にあります。

[Tab]キーまたは[→]キーを押した後:

フォーカスはCell[0, 1]をとばして[0, 2]に移動します。

//2列目にフォーカスが移動しないようにします
FpSpread1.Columns[1].CanFocus = false;
FpSpread1.Columns[1].BackColor = System.Drawing.Color.Pink;
'2列目にフォーカスが移動しないようにします
FpSpread1.Columns(1).CanFocus = False
FpSpread1.Columns(1).BackColor = System.Drawing.Color.Pink

クライアント側で処理することもできます。

<script type="text/javascript">
    window.onload = function () {
        var spread = document.getElementById("FpSpread1");
        //Cell[0,1]にフォーカスが移動しないように設定します
        spread.Cells(0,1).SetTabStop(false);
    }
</script>

 

 


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