.NET中的列表视图 [英] List View in .NET

查看:92
本文介绍了.NET中的列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在列表视图"的任何列中,如果添加的字符串超过250个(大约)个字符,则不会显示所有字符,列表视图"列中可能显示的字符数受限制. /> 如果必须在列表视图中显示250个以上的字符,该怎么办????

If in any Column of List View ,if a string having more than 250 (aprox)characters is added ,then all of the charcters are not displayed, There is limit of characters which may be displayed in List View Column.
What is the solution ,if we have to show more than 250 characters in List View????

推荐答案

您可以在文本的某个位置加上一个省略号,并且当用户将鼠标悬停在它上面时,您可以将整个文本显示为工具提示.

但是,如果需要在ListView单元中显示大量数据,也许您应该重新考虑您的总体设计.
You could put an elipse at some point in the text, and when the user hovers over it, you could display the entire text as a tooltip.

HOWEVER, if you need to display that much data in a ListView cell, maybe you should re-think youre overall design.


实际上,它是259 ...来自MSDN. :"ListViewItem的文本不应超过259个字符,否则可能会发生意外的行为."

我想说,试图在ListView中显示许多字符将使ListView不是控件的最佳选择.

Microsoft建议,如果要显示所选项目的文本,请在表单中添加一个文本框,当用户选择一个新的listviewitem时,请使用超过259个字符的列文本填充该文本框.或者,您可以使用工具提示...这是一个非常简单的解决方案.

或使用其他人创建的自定义列表视图,例如: http://www.codeproject.com/KB/list /aa_listview.asp [^ ]
actually, it''s 259...from MSDN: "The text of the ListViewItem should not exceed 259 characters or unexpected behavior could occur."

I would say that trying to display that many characters in a ListView would make the ListView not the best choice of control.

Microsoft suggests that if you want to show the text for a selected item, then add a textbox to the form and when the user selects a new listviewitem, populate the textbox with the text of the column that exceeds 259 characters. Or, you can use a tooltip...that''s a pretty simple solution.

Or use a custom listview that someone else has created such as: http://www.codeproject.com/KB/list/aa_listview.asp[^]


这篇关于.NET中的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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