GridView中模拟RadioButton组代码

protected void grb_customerID_CheckedChanged(object sender, EventArgs e)
    {
        //清除GridView中所有RadioButton的选中状态
        foreach (GridViewRow oldrow in gv_customerInfo.Rows)
        {
            ((RadioButton)oldrow.FindControl("grb_customerID")).Checked = false;
        }
        //查找当前行的RadioButton并将其Checked 状态设置为true

        RadioButton rb = (RadioButton)sender;
        GridViewRow row = (GridViewRow)rb.NamingContainer;
        ((RadioButton)row.FindControl("grb_customerID")).Checked = true;
    }

原文地址:https://www.cnblogs.com/xueyuan299/p/1283742.html