LISTVIEW次要问题 [英] LISTVIEW SUBITEM PROBLEM

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

问题描述

我想要的是垂直显示第16列中的记录..
但它们出现在第2列
但是如果我使用子项目,它们会水平出现


请帮助

all i want is to display the record in column 16 vertically..
but they appeared in column 2
but if i use subitem they appear horizontally


please help

While objDataReader.Read

    Dim item As ListView
    Dim row As ListViewItem = Me.lstLicense.Items(0)


    With row
        lstLicense.Items.Add(16).Text = (objDataReader("Division"))

    End With

推荐答案

您不能通过此语句在任何列中添加数据:

You can not add a data in any column by this statement:

lstLicense.Items.Add(16).Text = (objDataReader("Division"))



项目是ListView中的行而不是列,项目中的子项目可以将您带到您要查找的特定单元格.

为此,您需要创建一个包含16个子项的项目,然后将其添加到ListView.此页面上的示例将为您提供帮助:

http://msdn.microsoft.com/en-us/library/system.windows.forms.listviewitem.listviewsubitem.aspx [ ^ ]



Items are rows in ListView rather than a column, a subitem within a item can lead you to a specific cell that you are looking for.

so to do what you are looking for you need to a create an item which has 16 subitems and then you can add the item to the ListView. The example on this page would help you how to do it:

http://msdn.microsoft.com/en-us/library/system.windows.forms.listviewitem.listviewsubitem.aspx[^]


这篇关于LISTVIEW次要问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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