问题描述
单选按钮显示如下。首先显示文字及以下单选按钮(RB)
男性女性
RB RB
不显示在同一行中:
男RB女RB
我的代码如下
tc = new TableCell( );
tc1 =新的TableCell();
tc.Text = FieldeDescr;
RadioButtonList rbl = new RadioButtonList();
rbl.ID =rblID;
//添加物品
rbl .Items.Add(new ListItem(Male,1));
rbl.Items.Add(new ListItem(Female,2));
rbl.RepeatDirection = RepeatDirection.Horizontal;
rbl.TextAlign = TextAlign.Left;
rbl.DataBind();
tc 1.Controls.Add(rbl);
tr.Cells.Add(tc);
tr.Cells.Add(tc1);
The radio button is showing like below.first showing Text and below Radio button(RB)
Male Female
RB RB
not showing in same line like :
Male RB Female RB
my code is as follows
tc = new TableCell();
tc1 = new TableCell();
tc.Text = FieldeDescr;
RadioButtonList rbl = new RadioButtonList();
rbl.ID = "rblID";
//Add Items
rbl.Items.Add(new ListItem("Male", "1"));
rbl.Items.Add(new ListItem("Female", "2"));
rbl.RepeatDirection = RepeatDirection.Horizontal;
rbl.TextAlign = TextAlign.Left;
rbl.DataBind();
tc1.Controls.Add(rbl);
tr.Cells.Add(tc);
tr.Cells.Add(tc1);
推荐答案
这篇关于而添加单选按钮动态按钮和文本不显示在同一行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!