一项2行复选框列表c#

时间:2016-06-07 13:58:25

标签: c#

我想在字符串集合编辑器中有一个复选框项列表,但其中一个项目太长,所以我希望它放在换行符中。

我的清单就像这样 *无袖,露背,管,无肩带,露背
*意大利面条带,领口和领口等 *紧身,衬衫和连衣裙
*沙滩衣,衬衫,不覆盖中间部位
*短裙和裙子,比膝盖中间高出两(2)英寸

但我想要像这样

*无袖,露背,管,露肩,露背
*意大利面条带,领口和领口等 *紧身,衬衫和连衣裙
*沙滩衣,衬衫,不覆盖中间部位
*短礼服和裙子超过两(2)英寸
在膝盖中间

我希望最后一项是2行,但只计为一项,因为我知道如果你把它放在一个新行中,它将被视为另一项。谢谢。 :d

1 个答案:

答案 0 :(得分:0)

假设您使用的是asp.net webform。我只检查了你的例子中较大的文字。请查看以下html代码以供参考。

[![<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

<style type="text/css" media="all">
    .checkboxlist_nowrap tr td label
    {
        white-space:nowrap;
        overflow:hidden;
    }
</style> 
</head>

<body>
    <form id="form1" runat="server">
    <div style="border: solid 1px blue; width:300px">
    <asp:CheckBoxList ID="CheckBoxList2" runat="server">
        <asp:ListItem Value="0" Text="line 0"></asp:ListItem>
        <asp:ListItem Value="1" Text="*Short dresses and skirts that are more than two(2) inches above the middle of the knee "></asp:ListItem>
    </asp:CheckBoxList>
</div> 
    </form>
</body>
</html>][1]][1]