Dear Sir,
I have error "specified argument was out of the range of valid values parameter name : rowindex when press esc in keyboard after type in column m_product in VB.NET
Please Guide me
Thanks
Imports System.ComponentModel
Imports System.Reflection
Public Class Form2
Private list As BindingList(Of InvoicesDetailtest) = Nothing
Private BindingSource1 As BindingSource = Nothing
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
' To reduce the flickering...
DataGridView1.GetType().
GetProperty("DoubleBuffered",
BindingFlags.Instance Or BindingFlags.NonPublic).
SetValue(DataGridView1, True)
updateDataSource()
'Datagridview1.Focus()
End Sub
Private Sub updateDataSource()
' Our collection holding products
list = New BindingList(Of InvoicesDetailtest)()
' Create our medium between grid and collection
BindingSource1 = New BindingSource With {.DataSource = list}
DataGridView1.DataSource = BindingSource1
DataGridView1.AutoGenerateColumns = False
DataGridView1.AllowUserToAddRows = False
BindingSource1.AddNew()
End Sub
End Class
Public Class InvoicesDetailtest
Public Property m_product() As String
Public Property Qty() As Integer
End Class