Loop through every row, and find the radio button you want, then turn it off. Go back to the radio button that was originally selected, and then select it. We can do this because we can go back to the sender, find it, and modify it. Here's the code that does it:
protected void rdoPolicy_CheckedChanged(object sender, EventArgs e) { DeselectRBButtons(); RadioButton sendingRB = (RadioButton)sender; sendingRB.Checked = true; } private void DeselectRBButtons() { int x = 0; foreach (var gridviewRow in grdPolicies.Rows) { var rb = (RadioButton)grdPolicies.Rows[x].FindControl("rdoPolicy"); rb.Checked = false; x++; } }
No comments:
Post a Comment