加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

ASP.NET有一个复选框列表,在4×5网格中有我很好的复选框

发布时间:2020-12-16 07:21:29 所属栏目:asp.Net 来源:网络整理
导读:我有一个复选框列表,可以在列表中显示它们 ABCD 或水平的 A B C D 我想把它们安排在这样一个漂亮的网格中 A B C DE F G HI J K L 我该怎么做? 解决方法 您需要设置CheckBoxList的 RepeatDirection和 RepeatColumns属性. asp:CheckBoxList ID="myCheckBoxLis
我有一个复选框列表,可以在列表中显示它们

A
B
C
D

或水平的

A B C D

我想把它们安排在这样一个漂亮的网格中

A B C D
E F G H
I J K L

我该怎么做?

解决方法

您需要设置CheckBoxList的 RepeatDirection和 RepeatColumns属性.

<asp:CheckBoxList ID="myCheckBoxList" runat="server" 
     RepeatColumns="4" RepeatDirection="Horizontal">
 <asp:ListItem>A</asp:ListItem>
 <asp:ListItem>B</asp:ListItem> 
 <asp:ListItem>C</asp:ListItem>
 <asp:ListItem>D</asp:ListItem>
 <asp:ListItem>E</asp:ListItem>
 <asp:ListItem>F</asp:ListItem>
 <asp:ListItem>G</asp:ListItem>
 <asp:ListItem>H</asp:ListItem>
 <asp:ListItem>I</asp:ListItem>
 <asp:ListItem>J</asp:ListItem>
 <asp:ListItem>K</asp:ListItem>
 <asp:ListItem>L</asp:ListItem>
 <asp:ListItem>M</asp:ListItem>
 <asp:ListItem>N</asp:ListItem>
 <asp:ListItem>O</asp:ListItem>
 <asp:ListItem>P</asp:ListItem>
 <asp:ListItem>Q</asp:ListItem>
 <asp:ListItem>R</asp:ListItem>
 <asp:ListItem>S</asp:ListItem>
 <asp:ListItem>T</asp:ListItem>
</asp:CheckBoxList>

这将呈现4×5网格的复选框.

A B C D
E F G H
I J K L
M N O P
Q R S T

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读