listview框不在详细信息视图中显示数据(listview box not displaying data in details view)

编程入门 行业动态 更新时间:2024-10-23 16:17:02
listview框不在详细信息视图中显示数据(listview box not displaying data in details view)

我用多种形式搜索了这个问题,但找不到适用于我的答案..

我在Windows窗体应用程序中有一个列表视图框,我在运行时添加一些项目,如下所示的代码:

lvinfo.Items.Add("Script executed successfully in " + dbname + " database");

我使用多次相同的代码来执行更新,当我将视图作为列表或其他内容时,这可以正常工作...

而且我也没有在我的代码中随时清除这些项目。当我用Google搜索时,我可以找到与清除项目相关的答案。

我的问题是当我将视图属性设置为详细信息时,列表视图框中的文本/内容不会显示..或者它被隐藏..

编辑:

我试过了

columnHeader1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);

任何回应都会非常感激..

I googled this question in many forms but couldn't find an answer applicable to me also..

I have a list view box in windows forms application and in that I add some items in runtime like the code I shown below:

lvinfo.Items.Add("Script executed successfully in " + dbname + " database");

The same code I am using several times for updates of execution and this works fine when I give the view as list or something else...

And also I am not clearing these items at any point of time in my code..When I googled I could find the answers related to clearing items..

My problem is when I set view property as Details, the text/content in the list view box is not displayed..or it is hidden..

EDIT:

I tried

columnHeader1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);

Any response would be really appreciated..

最满意答案

我想这是因为你没有在列表视图中添加任何列。 在详细信息视图中,您应添加至少一列以显示您的项目。在添加项目之前尝试此操作:

listView1.Columns.Add("myColumnHeader");

I guess it is because you haven't add any columns to your list view. In details view you should add at least one column to display your item.Try this before adding your items:

listView1.Columns.Add("myColumnHeader");

更多推荐

本文发布于:2023-08-05 11:10:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1431211.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:详细信息   视图   数据   listview   box

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!