Okay so I know this is probably an easy question but I am tired and I want to find a good way to do this. The code below will show what I am getting into (I'll explain more after it)
string loc = dataGridView1.SelectedRows.ToString();
int loc2 = Convert.ToInt32(loc);
Anyway this little code goes into a if loop and has to deal with removing data off a datagridview without the risk of the user not clikcing anything and having it go into, a null pointer issue. I but the the think it when the I do that second line of code it has thrown this error "Input string was not in a correct format". I know I have run into this error and just went around it but now I want to find a proper way to do this