我想生成4行客户端radio组怎么实现

解决方案 »

  1.   

    使用服务器控件RadioButton,然后设置相同的GroupName
      

  2.   

    具体要看你的需求了用radiobuttonlist用repearter用radiobutton一个一个摆什么都行啊
      

  3.   

    protected System.Web.UI.HtmlControls.HtmlForm Form1;
    protected System.Web.UI.WebControls.Button Button1;private void Button1_Click(object sender, System.EventArgs e)
    {
    RadioButtonList r = new RadioButtonList();
    r.RepeatDirection = RepeatDirection.Horizontal;
    r.Items.Add(new ListItem("男", "M"));
    r.Items.Add(new ListItem("女", "F"));
    this.Form1.Controls.Add(r);
    }
      

  4.   

    RadioButtonList放在一个单元格里,我现在有4个radio 我想把radio分别放在一个单元格里,怎么去分割~我用的是服务器段的table 。RadioButtonList就放在TableCell里面
      

  5.   

    TableCell tasktc2 = new TableCell();
               
                tasktc2.BorderWidth = 1;
                RadioButtonList chk = new RadioButtonList();
                chk.ID = "rad"+i;
                ListItem l1 = new ListItem();
                l1.Value = "1";
                l1.Text = "";
                ListItem l2 = new ListItem();
                l2.Value = "2";
                l2.Text = "";
                ListItem l3 = new ListItem();
                l3.Value = "3";
                l3.Text = "";
                ListItem l4 = new ListItem();
                l4.Value = "4";
                l4.Text = "";
                chk.Items.Add(l1);
                chk.Items.Add(l2);
                chk.Items.Add(l3);
                chk.Items.Add(l4);
                chk.RepeatDirection = RepeatDirection.Horizontal;
                tasktc2.Controls.Add(chk);