0

我有一个带有 3 个单选按钮的网格视图。我如何知道选择了哪个单选按钮>

代码:

4

2 回答 2

2

请试一试

foreach (GridViewRow row in gridview.Rows)
{
    RadioButton radioBtn=new RadioButton();
    radioBtn=(RadioButton)row.findcontrol("YourRadiobuttonId");
    if(radioBtn.Checked)
    {
        // Your appropriate code here
    }

}
于 2012-04-19T15:45:42.477 回答
1

试试这个。

foreach (GridViewRow row in gridview.Rows)
{
RadioButton rbn=new RadioButton();
rbn=(RadioButton)row.findcontrol("YourRadiobuttonId");
if(rbn.Checked)
 {
    //Try your condition what u want
 }
}
于 2012-04-19T15:38:48.363 回答