Reputation: 810
I'm using checklistbox. I want to list all items like that
But there 2 selection in repeatdirection. Only horizontal and vertical.
Here is my code:
<asp:CheckBoxList runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text=" Monday "></asp:ListItem>
<asp:ListItem Text=" Tuesday "></asp:ListItem>
<asp:ListItem Text=" Wednesday "></asp:ListItem>
<asp:ListItem Text=" Thursday "></asp:ListItem>
<asp:ListItem Text=" Friday "></asp:ListItem>
<asp:ListItem Text=" Saturday "></asp:ListItem>
<asp:ListItem Text=" Sunday "></asp:ListItem>
</asp:CheckBoxList>
So I mean that half vertical and half horizontal. When row is full other items will be in next row.
How can I do that?
Upvotes: 2
Views: 4709
Reputation: 336
.myGroupCheckBox{
list-style:none;
width:270px;
}
.myGroupCheckBox li{
display: inline;
}
<asp:CheckBoxList ID="CheckBoxList1" runat="server" CssClass="myGroupCheckBox"
RepeatLayout="UnorderedList">
<asp:ListItem Text=" Monday "></asp:ListItem>
<asp:ListItem Text=" Tuesday "></asp:ListItem>
<asp:ListItem Text=" Wednesday "></asp:ListItem>
<asp:ListItem Text=" Thursday "></asp:ListItem>
<asp:ListItem Text=" Friday "></asp:ListItem>
<asp:ListItem Text=" Saturday "></asp:ListItem>
<asp:ListItem Text=" Sunday "></asp:ListItem>
</asp:CheckBoxList>
Upvotes: 0
Reputation: 176936
you can use this RepeatDirection
, RepeatColumns
, and RepeatLayout
:
<asp:CheckBoxList RepeatDirection="Horizontal"
RepeatColumns="2" RepeatLayout="Table" ...>
check more about property here : CheckBoxList Properties
Upvotes: 3