How to pass value from DataGridView to RadioButton
10:52 12 Feb 2019

How can I pass a value from a DataGridView to a radio button in VB.Net? I have tried the following code but it is not working:

If DataGridView1.Rows(e.RowIndex).Cells(2).Value.ToString.Equals("A") Then
    RadioButton1.Checked = True
ElseIf DataGridView1.Rows(e.RowIndex).Cells(2).Value.ToString.Equals("B") Then
    RadioButton2.Checked = True
End If
  
vb.net