回复 5楼dafo的帖子
使用干净的Sample也不好使。
Private Sub EidtMultiRow_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.GcMultiRow1.EditMode = GrapeCity.Win.MultiRow.EditMode.EditOnEnter
Me.GcMultiRow1.ShortcutKeyManager.Clear()
End Sub
Private Sub GcMultiRow1_KeyDown(sender As Object, e As KeyEventArgs) Handles GcMultiRow1.KeyDown
If e.KeyCode = Keys.Enter Then
GrapeCity.Win.MultiRow.SelectionActions.MoveToNextCell.Execute(Me.GcMultiRow1)
End If
End Sub
Private Sub GcMultiRow1_EditingControlShowing(sender As Object, e As GrapeCity.Win.MultiRow.EditingControlShowingEventArgs) Handles GcMultiRow1.EditingControlShowing
Dim controlType As String = e.Control.GetType.Name
If controlType = "TextBoxEditingControl" Then
Dim tbControl As TextBoxEditingControl = TryCast(e.Control, TextBoxEditingControl)
If tbControl IsNot Nothing Then
RemoveHandler tbControl.KeyDown, AddressOf Me.GcMultiRow1_KeyDown
AddHandler tbControl.KeyDown, AddressOf Me.GcMultiRow1_KeyDown
End If
End If
End Sub
Private Sub GcMultiRow1_CellValidating(sender As Object, e As CellValidatingEventArgs) Handles GcMultiRow1.CellValidating
If e.FormattedValue = "123" Then
Me.GcMultiRow1.CurrentCell.Style.BackColor = Color.Red
e.Cancel = True
End If
End Sub |