如何填充在asp.net中的DropDownList长文本 [英] How to populate long text in dropdownlist in asp.net

查看:134
本文介绍了如何填充在asp.net中的DropDownList长文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net,我试图填充一个DropDownList框很长的文本。我有固定的页面列表的宽度,我不想改变它的大小,因为它会影响到我的页面布局。在点击DropDownList中,文本被截断的下拉列表的大小。我希望看到没有任何截断整个文本,在不改变的DropDownList box..Also的大小,如果有会解决这个问题的任何第三方控件?将是非常有益的,如果有一个解决方案这一点。

In asp.net, am trying to populate a dropdownlist box with very long text. I have fixed the width of list on the page and i don't want to change its size as it would affect my page layout. On clicking the dropdownlist, the text gets truncated to the size of the dropdown. I want to see the entire text without any truncation, without changing the size of the dropdownlist box..Also if there are any third party controls which would solve this problem?Would be very helpful if there's a solution for this.

目前正在尝试在一个jQuery的下拉框,如果超过size..but将自动换行再次,问题是它工作正常上一个独立的解决方案,但是当我它与我的应用程序集成,它不读.css文件,并没有做任何的格式(样式,字体,对齐),它应该根据的.css file.Any知道为什么发生这种情况呢?

Right now am trying a dropdown box in Jquery that will wrap the text if it exceeds the size..but again the problem is it works fine on an independent solution but when i integrate it with my application, it does not read the .css file and it does not do any formatting(style, font, alignment) that it is supposed to do according to the .css file.Any idea why this is happening?

推荐答案

您可能能够使用jQuery创建就像当你将鼠标悬停在每个选项出现事情的工具提示。

You might be able to use jQuery to create a tooltip like thing that appears when you hover over each option.

// this executes on page load - just like asp.net Page_load()
function pageLoad(){
// attach a mouseover event to each option in your dropdown
$("#myDropdown option").mouseover(function(){
      // get the text from that option
      var text = $("#"+this.id).text();
      // display that text in a small tooltip
      showToolTip(text);

});

}

function showToolTip(text){
     // display in some way
}

有一个名为JavaScript库 wz_tooltip 可在 walterzorn.com

there's a javascript library called wz_tooltip available at walterzorn.com

希望帮助

这篇关于如何填充在asp.net中的DropDownList长文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆