ショートカットキーによるセルの移動でタブオーダーが使用されない

文書番号 : 17408     文書種別 : 不具合     最終更新日 : 2005/04/28
文書を印刷する
対象製品
El Tabelle for .NET 3.0J
発生環境
この現象は 次のファイルバージョンのアセンブリで発生します。
v3.0.2005.0204
v3.0.2005.0218 (HotFix)
v3.0.2005.0310 (HotFix)
v3.0.2005.0415 (HotFix)
v3.0.2005.0610 (HotFix)
状況
修正済み
詳細
MultiRowSheet でショートカットキーによるセルの移動を行ったとき、
テンプレートに設定されているタブオーダーが使用されません。セルは常に左から右、上から下へ移動します。

次のサンプルコードでは、Tabキーで移動した場合と、Enterキーで移動した場合とで違いを確認できます。

[Visual Basic]
Dim objTemplate As GrapeCity.Win.ElTabelle.Template = _
  New GrapeCity.Win.ElTabelle.Template

objTemplate.Cells(1, 1).TabIndex = 0
objTemplate.Cells(1, 0).TabIndex = 1
objTemplate.Cells(0, 1).TabIndex = 2
objTemplate.Cells(0, 0).TabIndex = 3

'MultiRowSheetにテンプレートを適用する
Dim objMemoryStream As New System.IO.MemoryStream
GrapeCity.Win.ElTabelle.TemplateFileProcessor.Save(objMemoryStream, objTemplate)
MultiRowSheet1.LoadTemplate(objMemoryStream)

Dim aryMKeyActions(0) As GrapeCity.Win.ElTabelle.MKeyAction
'Enterキーで次のセルに移動する
aryMKeyActions(0) = GrapeCity.Win.ElTabelle.MKeyAction.NextCellWithWrap
Dim objMShortcutEnter As New GrapeCity.Win.ElTabelle.MShortcut( _
  Keys.Enter, aryMKeyActions)
'ショートカットを追加する
MultiRowSheet1.Shortcuts.Add(objMShortcutEnter)

[C#]
GrapeCity.Win.ElTabelle.Template objTemplate =
  new GrapeCity.Win.ElTabelle.Template();

objTemplate.Cells[1, 1].Value = 0;
objTemplate.Cells[1, 1].TabIndex = 0;
objTemplate.Cells[1, 0].Value = 1;
objTemplate.Cells[1, 0].TabIndex = 1;
objTemplate.Cells[0, 1].Value = 2;
objTemplate.Cells[0, 1].TabIndex = 2;
objTemplate.Cells[0, 0].Value = 3;
objTemplate.Cells[0, 0].TabIndex = 3;

//MultiRowSheetにテンプレートを適用する
System.IO.MemoryStream objMemoryStream = new System.IO.MemoryStream();
GrapeCity.Win.ElTabelle.TemplateFileProcessor.Save(objMemoryStream, objTemplate);
multiRowSheet1.LoadTemplate(objMemoryStream);

//Enterキーで次のセルに移動する
GrapeCity.Win.ElTabelle.MKeyAction[] aryMKeyActions =
  new GrapeCity.Win.ElTabelle.MKeyAction[1];
aryMKeyActions[0] = GrapeCity.Win.ElTabelle.MKeyAction.NextCellWithWrap;
GrapeCity.Win.ElTabelle.MShortcut objMShortcutEnter =
  new GrapeCity.Win.ElTabelle.MShortcut(Keys.Enter, aryMKeyActions);
multiRowSheet1.Shortcuts.Add(objMShortcutEnter);
回避方法
この現象は、仕様によるものです。WorkBook/Sheet と同名の定数は、WorkBook/Sheet コントロールと同じ仕様となっています。
この現象は、アセンブリ バージョン v3.1.2005.0615 以降で、タブオーダーにしたがって移動する PrevTabOrder および NextTabOrder の追加により改善されました。

修正版は こちら からダウンロードできます。

修正版適用後、次のようにコーディングを行います。

[Visual Basic]
Dim objTemplate As GrapeCity.Win.ElTabelle.Template = _
  New GrapeCity.Win.ElTabelle.Template

objTemplate.Cells(1, 1).Value = 0
objTemplate.Cells(1, 1).TabIndex = 0
objTemplate.Cells(1, 0).Value = 1
objTemplate.Cells(1, 0).TabIndex = 1
objTemplate.Cells(0, 1).Value = 2
objTemplate.Cells(0, 1).TabIndex = 2
objTemplate.Cells(0, 0).Value = 3
objTemplate.Cells(0, 0).TabIndex = 3

'MultiRowSheetにテンプレートを適用する
MultiRowSheet1.Template = objTemplate

Dim aryMKeyActions(0) As GrapeCity.Win.ElTabelle.MKeyAction
'Enterキーで次のタブオーダーに移動する
aryMKeyActions(0) = GrapeCity.Win.ElTabelle.MKeyAction.NextTabOrder
Dim objMShortcutEnter As New GrapeCity.Win.ElTabelle.MShortcut( _
  Keys.Enter, aryMKeyActions)
'ショートカットを追加する
MultiRowSheet1.Shortcuts.Add(objMShortcutEnter)

[C#]
GrapeCity.Win.ElTabelle.Template objTemplate =
  new GrapeCity.Win.ElTabelle.Template();

objTemplate.Cells[1, 1].Value = 0;
objTemplate.Cells[1, 1].TabIndex = 0;
objTemplate.Cells[1, 0].Value = 1;
objTemplate.Cells[1, 0].TabIndex = 1;
objTemplate.Cells[0, 1].Value = 2;
objTemplate.Cells[0, 1].TabIndex = 2;
objTemplate.Cells[0, 0].Value = 3;
objTemplate.Cells[0, 0].TabIndex = 3;

//MultiRowSheetにテンプレートを適用する
multiRowSheet1.Template = objTemplate;

//Enterキーで次のタブオーダーに移動する
GrapeCity.Win.ElTabelle.MKeyAction[] aryMKeyActions =
  new GrapeCity.Win.ElTabelle.MKeyAction[1];
aryMKeyActions[0] = GrapeCity.Win.ElTabelle.MKeyAction.NextTabOrder;
GrapeCity.Win.ElTabelle.MShortcut objMShortcutEnter =
  new GrapeCity.Win.ElTabelle.MShortcut(Keys.Enter, aryMKeyActions);
multiRowSheet1.Shortcuts.Add(objMShortcutEnter);
キーワード
ELTB04731

この文書は、以前は次のバグレポートIDで公開されていました : 4846