I want to access a DataGridView from another form. I just want to get a value from DataGridView and show it in a textbox located in another form.
As shown in the photo: I click Edit line button and Form2 pops up, so when i click button1, textbox1 should have the value of row[0] cell[0] (which is "1") but instead i get this Error: 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.
Is there anything I am missing? I made DataGridView Modifiers = Public but still didn't work. please help thank you.