I'm doing a simple datagridview update function
I have 2 forms. 1 for datagridview and another for the textboxes for update purpose.
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
The error was thrown at this code
Form1.DataGridView1.SelectedRows(0).Cells(3).Value = txtName.Text
But in Form1 i have a code that takes the current data in datagridview and it works perfectly.
Dim name As String = DataGridView1.SelectedRows(0).Cells(3).Value.ToString
Form2.txtName.Text = name