rb1 = (RadioButton)row.FindControl("radioButton1");
is the line that is causing the error. You are only looking for radioButton1. You would have to try something like this
foreach (GridViewRow row in GridView1.Rows)
{
string rbName = "radioButton" + i.ToString();
rb1 = (RadioButton)row.FindControl(rbName);
if (rb1.Checked = true)
{
drugId = (String)row.Cells[1].Text;
}
i += 1;
}
Hope this helps