Imports Syncfusion.WinForms.DataGrid
Imports Syncfusion.WinForms.DataGrid.Interactivity

Public Class MyForm
	'Public dGrid As SfDataGrid  'Uncomment for test without designer
	
	Public Sub New()
		'dGrid = New SfDataGrid  'Uncomment for test without designer
		dGrid.SelectionController = New CustomSelectionController(dGrid)
		Compile()
	End Sub
	
	Public Sub Compile()
		Dim myList As New List(Of Content) From {New Content(1, "Hello")}
		dGrid.DataSource = myList
	End Sub
End Class

Public Class Content
	Private _id as Integer
	Private _str as String
	
	Public Sub New(_id As Integer, _str As String)
		Me._id = _id
		Me._str = _str
	End Sub
	
	Public ReadOnly Property ID As Integer
        Get
            Return _id
        End Get
    End Property
	
	Public ReadOnly Property Str As String
        Get
            Return _str
        End Get
    End Property
End Class

Public Class CustomSelectionController
    Inherits RowSelectionController

    Public Sub New(ByVal dataGrid As SfDataGrid)
        MyBase.New(dataGrid)
    End Sub

    Protected Overrides Sub HandleKeyOperations(args As KeyEventArgs)
        If args.KeyCode = Keys.Enter Then
            Return
        End If

        MyBase.HandleKeyOperations(args)
    End Sub
End Class