作成日: 2017/06/22 最終更新日: 2017/06/22
文書種別
不具合
状況
回避方法あり
詳細
C1FlexGridで複数階層(例:3階層)グリッドを作成し、子階層(例:2階層)の要素を同じ階層内でドラッグ&ドロップしようとしても、移動できない時があります。
これは、C1FlexGridのBeforeDragRowイベントにおけるe.Position引数が、行ヘッダー上のマウス・カーソルの位置によって、次のように異なる値を戻しているためです。
・移動先の行で、マウスカーソルのほとんどがラインセパレータより上にある状態でドロップした場合、e.Positionは、現在の行ヘッダーインデックスの次の値を戻します(不正)。
・移動先の行で、ママウスカーソルのほとんどがラインセパレータより下にある状態でドロップした場合、e.Positionは、次のノードの値を戻します(正しい)。
これは、C1FlexGridのBeforeDragRowイベントにおけるe.Position引数が、行ヘッダー上のマウス・カーソルの位置によって、次のように異なる値を戻しているためです。
・移動先の行で、マウスカーソルのほとんどがラインセパレータより上にある状態でドロップした場合、e.Positionは、現在の行ヘッダーインデックスの次の値を戻します(不正)。
・移動先の行で、ママウスカーソルのほとんどがラインセパレータより下にある状態でドロップした場合、e.Positionは、次のノードの値を戻します(正しい)。
回避方法
マウスカーソルの位置がどこであっても、C1FlexGridのBeforeDragRowイベント内で、次のノードのインデックスを指すように修正します。
(例)
◎サンプルコード(VB)
◎サンプルコード(C#)
(例)
◎サンプルコード(VB)
Dim beforeRow As Integer = e.Row
Dim afterRow As Integer = e.Position
Dim currentRow As Integer = afterRow
While (Not (fg.Rows(currentRow).IsVisible) AndAlso currentRow < fg.Rows.Count)
currentRow = currentRow + 1
End While
If (currentRow <> fg.Rows.Count) Then
afterRow = currentRow
End If
Dim afterRow As Integer = e.Position
Dim currentRow As Integer = afterRow
While (Not (fg.Rows(currentRow).IsVisible) AndAlso currentRow < fg.Rows.Count)
currentRow = currentRow + 1
End While
If (currentRow <> fg.Rows.Count) Then
afterRow = currentRow
End If
◎サンプルコード(C#)
int beforeRow = e.Row;
int afterRow = e.Position;
int currentRow = afterRow;
while ((!(fg.Rows[currentRow].IsVisible) && currentRow < fg.Rows.Count))
{
currentRow = currentRow + 1;
}
if ((currentRow != fg.Rows.Count))
{
afterRow = currentRow;
}
int afterRow = e.Position;
int currentRow = afterRow;
while ((!(fg.Rows[currentRow].IsVisible) && currentRow < fg.Rows.Count))
{
currentRow = currentRow + 1;
}
if ((currentRow != fg.Rows.Count))
{
afterRow = currentRow;
}
旧文書番号
82231