我有一个带有 3 个单选按钮的网格视图。我如何知道选择了哪个单选按钮>
代码:
请试一试
foreach (GridViewRow row in gridview.Rows)
{
RadioButton radioBtn=new RadioButton();
radioBtn=(RadioButton)row.findcontrol("YourRadiobuttonId");
if(radioBtn.Checked)
{
// Your appropriate code here
}
}
试试这个。
foreach (GridViewRow row in gridview.Rows)
{
RadioButton rbn=new RadioButton();
rbn=(RadioButton)row.findcontrol("YourRadiobuttonId");
if(rbn.Checked)
{
//Try your condition what u want
}
}