回复 16楼rbgongming的帖子
非常感谢您,找到解决方案了,方法如下:
将在Template的单元格Cell(GcTextBox)的属性
GcTextBox.ExitOnArrowKey = True
这样做以后,虽然可以上下移动,但是出现了当移动到表格的最后一行的时候,继续按下键,始终会跳到最后一个Cell上,需要补充如下代码
Private Sub GcMultiRow1_EditingControlShowing(ByVal sender As Object, ByVal e As GrapeCity.Win.MultiRow.EditingControlShowingEventArgs) Handles GcMultiRow1.EditingControlShowing
RemoveHandler e.Control.KeyDown, AddressOf editor_KeyDown
AddHandler e.Control.KeyDown, AddressOf editor_KeyDown
End Sub
Private Sub editor_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If e.KeyCode = Keys.Down Then
If Me.GcMultiRow1.CurrentRow.Index = Me.GcMultiRow1.RowCount - 1 Then
Me.GcMultiRow1.CurrentCell = Me.GcMultiRow1.Rows(Me.GcMultiRow1.RowCount - 1).Cells(Me.GcMultiRow1.CurrentCell.CellIndex)
Me.GcMultiRow1.Focus()
Else
Me.GcMultiRow1.CurrentCell = Me.dp_nc0232.Rows(Me.GcMultiRow1.CurrentRow.Index + 1).Cells(Me.GcMultiRow1.CurrentCell.CellIndex)
Me.GcMultiRow1.Focus()
End If
End If
If e.KeyCode = Keys.Up Then
If Me.GcMultiRow1.CurrentRow.Index = 0 Then
e.SuppressKeyPress = True
Me.GcMultiRow1.CurrentCell = Me.GcMultiRow1.Rows(0).Cells(Me.GcMultiRow1.CurrentCell.CellIndex)
Me.GcMultiRow1.Focus()
Else
Me.GcMultiRow1.CurrentCell = Me.GcMultiRow1.Rows(Me.GcMultiRow1.CurrentRow.Index - 1).Cells(Me.GcMultiRow1.CurrentCell.CellIndex)
Me.GcMultiRow1.Focus()
End If
End If
End Sub |