可以在asp.net中的dropdowncheckbox中获取text-wrap属性

时间:2016-09-26 09:44:46

标签: c# asp.net

在我的网络应用程序中,我需要在部分框中显示所选文本,如果我检查了许多名称,我需要在另一行中显示文本,任何人都告诉我是否可以这样做。我需要在选择框中显示所有选定的项目。

我得到的结果如image here。但我需要在选择框中显示所有选中的项目。我怎么能这样做。

.aspx:

    <asp:DropDownCheckBoxes ID="dropdown1" runat="server" AddJQueryReference="true" UseSelectAllNode="true" UseButtons="true"  
OnSelectedIndexChanged="dropdown1_SelectedIndexChanged"
     AutoPostBack="true" CssClass="drpdwnstyle" Width="700px" >              
                        </asp:DropDownCheckBoxes>


  <style type="text/css">
     .drpdwnstyle {
            width: 250px;        
            position:absolute;              
            text-align: left;
            text-overflow: ellipsis;
            direction: ltr;                      
        }</style>

.CS:

  protected void dropdown1_SelectedIndexChanged(object sender, EventArgs e)
        {

            List<String> checkedList = new List<string>();
            foreach (ListItem item in dropdown1.Items)
            {
                if (item.Selected)
                {
                    checkedList.Add(item.Value);
                }
            }
            dropdown1.Texts.SelectBoxCaption = String.Join(",", checkedList.ToArray());    

谢谢

1 个答案:

答案 0 :(得分:0)

删除 text-overflow:省略号;  添加 white-space:initial;

ManagedExecutorService

相关问题