You may want to prevent the end user from editing the data in particular cells. If you choose, you can lock individual grid cells from being edited at run time by using the FetchCellStyle event.
FetchCellStyle イベントを使用して、個別のグリッドセルをロックできます。セル(1, 0)の値をロックするには
デザイナの場合
コードの場合
Form_Load イベントに次のコードを追加します。Form_Load イベントに次のコードを追加します。
C# |
コードのコピー
|
---|---|
this.c1TrueDBGrid1.Splits[0].DisplayColumns[0].FetchStyle = true; |
行 1 の値に対してのみ、CellStyleオブジェクトのLockedプロパティを True に設定します。
C# |
コードのコピー
|
---|---|
private void C1TrueDBGrid1_FetchCellStyle(object sender, C1.Win.C1TrueDBGrid.FetchCellStyleEventArgs e) { if (e.Row == 1) { e.CellStyle.Locked = true; } } |