我gidview控件里有两个RadioButton控件
现在要做的是
当我选择RadioButton控件的时候
就激发事件!我只需要我选择的那一行激发事件..其他的就免了...知道我的意思吗?急啊!!!!不清楚的请问!

解决方案 »

  1.   

    比如现在我的代码是    protected void rbOk_CheckedChanged(object sender, EventArgs e)
        {
            EditCartoon ok = new EditCartoon();
            ok.OkNo(((RadioButton)gvTitle.Rows[这里要填写什么呢??高手帮忙].FindControl("rbOk")).Text);
        }
      

  2.   

    绑定时给控件定义事件,这个是checkbox的radio也一样
       protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                HtmlInputCheckBox ChkSel = (HtmlInputCheckBox)e.Row.FindControl("chkSelect");
                string pstr ="'"+ e.Row.Cells[1].Text.Trim() + "','" + e.Row.Cells[2].Text.Trim()+"'";
                ChkSel.Value = pstr;            ChkSel.Attributes.Add("onclick", "AddRemoveValues(this,'" + e.Row.FindControl("texQualiey").ClientID + "')");        }
        }
      

  3.   

    LS的不行我的是web控件RadioButton不是html控件谁帮帮我啊!
      

  4.   


        protected void rbOk_CheckedChanged(object sender, EventArgs e)
        {
            EditCartoon ok = new EditCartoon();
            ok.OkNo(((RadioButton)((RadioButton)sender).Parent.Parent.FindControl("rbOk"))).Text);
        } 
      

  5.   

    我把我的需求说清楚点吧!我要做的是!是否呈现在主页的导航.
    导航我是用GridView呈现的..(公司要我这样)
    然后我写好主页的表头的GridView了..
    表头呈现的字段用这个sql语句实现:
    select TName,Cid,OkNo from Title where OkNo= '是'
    可是我现在在后台写一个是否呈现在首页的代码
    用一个GridView显示出可以呈现的字段..
    然后根据一个sql语句更新表:
    string sqlcmd = "select CName,CSum,CIntro from Media where Cid = '"+id+"'";
    GridView只有两个字段!一个是Name字段!还有一个就是选择是否呈现在主页的字段!
    用两个RadioButton来实现选择的是还是否!GroupName已经设置为一样!
    如果选择是的话.就根据参数得到RadioButton的text值:"是"
    这样!select CName,CSum,CIntro from Media where Cid = '是'";
    可是~我不知道要怎么弄是选择了那一行记录
    就更新该行记录!!!!!望赐教!!!!!
      

  6.   

    RadioButton1_CheckedChanged
    判断RadioButton1的值,
    然后是静态变化,还是动态变化(数据库处理)全都是你说了算