开发者

c# Listview displaying in lines

开发者 https://www.devze.com 2022-12-28 02:14 出处:网络
Basically I have a Listview control which has coloums (displayed in Detail mode) I add items to it that I want displayed, each under 1 colomn (Like an invoice) but it displays them all under the first

Basically I have a Listview control which has coloums (displayed in Detail mode) I add items to it that I want displayed, each under 1 colomn (Like an invoice) but it displays them all under the first instead. I've been adding items like this below which I guess is the wrong way to do it but every other way I tried is not working. You can see he result in the screenshot.

lstVLine.Items.Add(lineItem, lstVLine.Items.Count);  

lstVLine.Items.Add(itemName,lstVLi开发者_运维知识库ne.Items.Count);

c# Listview displaying in lines


You need to create SubItems for each of the additional fields:

ListViewItem item = new ListViewItem ("Something");
item.SubItems.Add ("Brand info");
item.SubItems.Add ("Type info");
lstVLine.Items.Add(item);
0

精彩评论

暂无评论...
验证码 换一张
取 消