読み取り専用モードの違い
対象製品
El Tabelle Sheet 4.0J
詳細
El Tabelle Sheet 4.0J は、複数の読み取り専用モードを備えています。エンドユーザーに許可したい操作に合わせて、モードを選択することができます。
Sheet.ViewMode プロパティに DisplayOnly を設定する
シート全体が表示専用のモードとなります。セルの選択や編集はすべて禁止されます。ユーザーは、スクロールのみ操作可能です。
Sheet.EditType プロパティに ReadOnly を設定する
セルの編集が禁止されます。スクロールやセルの選択、セル範囲の選択は可能です。
EnterEdit イベントでセルの編集開始をキャンセルする
Sheet.EditType プロパティを使用する場合と同じですが、イベントを使用するため、セルの値を判定し、その結果によって読み取り専用にするかどうかを設定できます。
[Visual Basic]
[C#]
TextEditor.ReadOnly プロパティを true に設定する
セル内のテキストの選択とコピーを許可します。ReadOnly プロパティは、入力可能なセル型で提供されています。
[Visual Basic]
[C#]
その他
El Tabelle Sheet 4.0J では、セルのイベントを無効にする Cell.Enabled プロパティ、セルへの移動を禁止する Cell.CanActivate プロパティが提供されています。これらのプロパティを使用することで、実質的に読み取り専用と同じ動作を実現することもできます。
Sheet.ViewMode プロパティに DisplayOnly を設定する
シート全体が表示専用のモードとなります。セルの選択や編集はすべて禁止されます。ユーザーは、スクロールのみ操作可能です。
Sheet.EditType プロパティに ReadOnly を設定する
セルの編集が禁止されます。スクロールやセルの選択、セル範囲の選択は可能です。
EnterEdit イベントでセルの編集開始をキャンセルする
Sheet.EditType プロパティを使用する場合と同じですが、イベントを使用するため、セルの値を判定し、その結果によって読み取り専用にするかどうかを設定できます。
[Visual Basic]
Private Sub Sheet1_EnterEdit(ByVal sender As Object, _
ByVal e As GrapeCity.Win.ElTabelle.EnterEditEventArgs) _
Handles Sheet1.EnterEdit
e.Cancel = True
End Sub
ByVal e As GrapeCity.Win.ElTabelle.EnterEditEventArgs) _
Handles Sheet1.EnterEdit
e.Cancel = True
End Sub
[C#]
private void sheet1_EnterEdit(object sender, GrapeCity.Win.ElTabelle.EnterEditEventArgs e)
{
e.Cancel = true;
}
{
e.Cancel = true;
}
TextEditor.ReadOnly プロパティを true に設定する
セル内のテキストの選択とコピーを許可します。ReadOnly プロパティは、入力可能なセル型で提供されています。
[Visual Basic]
Sheet1.CellRange = New GrapeCity.Win.ElTabelle.Range("*:*")
Dim objTextEditor As GrapeCity.Win.ElTabelle.Editors.TextEditor = _
New GrapeCity.Win.ElTabelle.Editors.TextEditor()
objTextEditor.ReadOnly = True
Sheet1.CellEditor = objTextEditor
Sheet1.CellText = "ABC"
Dim objTextEditor As GrapeCity.Win.ElTabelle.Editors.TextEditor = _
New GrapeCity.Win.ElTabelle.Editors.TextEditor()
objTextEditor.ReadOnly = True
Sheet1.CellEditor = objTextEditor
Sheet1.CellText = "ABC"
[C#]
sheet1.CellRange = new GrapeCity.Win.ElTabelle.Range("*:*");
GrapeCity.Win.ElTabelle.Editors.TextEditor objTextEditor =
new GrapeCity.Win.ElTabelle.Editors.TextEditor();
objTextEditor.ReadOnly = true;
sheet1.CellEditor = objTextEditor;
sheet1.CellText = "ABC";
GrapeCity.Win.ElTabelle.Editors.TextEditor objTextEditor =
new GrapeCity.Win.ElTabelle.Editors.TextEditor();
objTextEditor.ReadOnly = true;
sheet1.CellEditor = objTextEditor;
sheet1.CellText = "ABC";
その他
El Tabelle Sheet 4.0J では、セルのイベントを無効にする Cell.Enabled プロパティ、セルへの移動を禁止する Cell.CanActivate プロパティが提供されています。これらのプロパティを使用することで、実質的に読み取り専用と同じ動作を実現することもできます。
キーワード
機能・仕様
この文書は、以前は次のFAQ IDで公開されていました : 9000