而添加单选按钮动态按钮和文本不显示在同一行。 [英] while adding radio button dynamically button and text are not showing in same line.

查看:271
本文介绍了而添加单选按钮动态按钮和文本不显示在同一行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单选按钮显示如下。首先显示文字及以下单选按钮(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.Horizo​​ntal;

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);

推荐答案

检查父对象的宽度,尝试根据需要设置样式。
Check the width of parent object, try to style it as required.


这篇关于而添加单选按钮动态按钮和文本不显示在同一行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆