updatepanel中的GridView中的radiobuttonList怎么设置样式

步骤:

1:在单选按钮组控件中 添加属性 RepeatLayout ,其值选“flow”<asp:RadioButtonList ID="rblcellstat" runat="server" Width="240px" RepeatDirection="Horizontal" RepeatLayout="flow">

(说明:选“flow”,RadioButtonList控件在网页中显示为<span></span>形式,若选“table”,在网页中显示<table><tr><td></td></tr></table>形式的html代码)

2:在css文件中写样式

span.includerbl input{text-align:center;border: 0px 0px 0px 0px} /* by  djh */

3:引用样式文件<link href="http://www.cnblogs.com/include/main05.css" type="text/css" rel="stylesheet" />

自动启用

 

RepeatLayout="flow" 时,网页源代码文如下:

<table cellpadding="0" cellspacing="0" width="100%"  class="outer">
            <tr>
                <td style="text-align:right">設定格子狀態:</td>
                <td style="width:260px">
                 <span id="rblcellstat" style="display:inline-block;width:240px;"><input id="rblcellstat_0" type="radio" name="rblcellstat" value="1" checked="checked" /><label for="rblcellstat_0">正常</label><input id="rblcellstat_1" type="radio" name="rblcellstat" value="2" /><label for="rblcellstat_1">滿格</label><input id="rblcellstat_2" type="radio" name="rblcellstat" value="3" /><label for="rblcellstat_2">停用</label><input id="rblcellstat_3" type="radio" name="rblcellstat" value="4" /><label for="rblcellstat_3">抽盤</label></span></td>
                <td><input type="submit" name="btnSet" value="設定" id="btnSet" style="width:80px;" /></td>
            </tr>
         </table>

 

RepeatLayout="table" 时,文如下:

<table cellpadding="0" cellspacing="0" width="100%"  class="outer">

  <tr><td style="text-align:right">设定格子状态:</td>

      <td class="includerbl" style="width:260px">

<table id="rblcellstat" border="0" style="width:240px;">

          <tr><td><input id="rblcellstat_0" type="radio" name="rblcellstat" value="1" checked="checked" /><label for="rblcellstat_0">正常</label></td>

<td><input id="rblcellstat_1" type="radio" name="rblcellstat" value="2" /><label for="rblcellstat_1">满格</label></td>

<td><input id="rblcellstat_2" type="radio" name="rblcellstat" value="3" /><label for="rblcellstat_2">停用</label></td>

          </tr></table>

     </td>

    </tr>

 </table>

转载于:https://www.cnblogs.com/chengpeng/archive/2011/09/27/2192970.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值