, TemplateField, , rbSelector_CheckedChanged()...
protected void rbSelector_CheckedChanged (object sender, System.EventArgs e)
{
foreach (GridViewRow oldrow in GridView1.Rows)
{
((RadioButton)oldrow.FindControl("rbSelector")).Checked = false;
}
RadioButton rb = (RadioButton)sender;
GridViewRow row = (GridViewRow)rb.NamingContainer;
((RadioButton)row.FindControl("rbSelector")).Checked = true;
}
If a problem arises, just let me know, okay? Hope this code can help newbies like me.
Amit Patel
source
share