gridview中实现radiobutton的单选示例 c# 代码 复制代码 代码如下: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { RadioButton rb = (RadioButton)e.Row.FindControl("rbtSelect"); if (rb != null) rb.Attributes.Add("onclick", "onClientClick('" + rb.ClientID + "','" + e.Row.RowIndex + "')"); //把选中行的RowIndex也传过去,提交后在服务器端取值时用 } } javascript代码 复制代码 代码如下: hmtl代码: 复制代码 代码如下: <%#Eval("AA") %>