设置asp下拉列表选择框的宽度

时间:2013-04-09 06:58:20

标签: asp.net drop-down-menu

我之前遇到过类似的问题(答案)。他们没有我需要的东西。我需要我的下拉宽度始终保持不变。即使它下降&物品比宽度宽。较宽的项目应显示为工具提示。你怎么做到这一点?选择元素的处理是什么?为什么每个帖子都有“选择”的答案。我正在使用asp下拉列表。我该如何使用select?无论如何,这是我的ddl的CSS:

.ddl2
{
margin-top: 10px;
margin-bottom: 10px;
border-style: solid;
border-width: thin;
border-color: Gray;
height: 20px;
max-width: 150px;
}

当没有选择任何内容时(仅在Firefox中)。一旦ddl下降,selectbox就会获得最宽元素的宽度。

编辑:

   try
        {

            DataSet dsCountry = objBindDDL.BindDropDownListToACountry();
            ddlCountry.DataSource = dsCountry.Tables["ACountry"];
            ddlCountry.DataTextField = "CountryName";
            ddlCountry.DataValueField = "ID";
            ddlCountry.DataBind();
            ddlCountry.Items.Insert(0, new ListItem("Please select Country", ""));
        }

0 个答案:

没有答案