I have two columns in my listView, lets call them Column1, and Column2.
Is it possible to add a bunch of items to column2 only, and make it so those items only go strictly under column2 and not column1?
When I add items it adds an item to Column2, and Column1 and I don’t want that.
How would I go about doing this?
Here’s some of my test code. I made an array with two strings. I want both of those strings to go under column2 (each in their own row) and not under column1. When I test it, they still go under column2 AND column1 which is what I don’t want.
string[] h = {"Hi","Hello"};
listViewGoogleInsight.Items.Add(new ListViewItem(h));
Heres the code Im trying to do now. The first portion adds items to column1, the second part adds items to column 2. So far it is making a lot of blank spaces under column 2 before showing the column 2 items link . How do I fix this?:
string[] n = getBetweenAll(site, "('rising drilldown', '", "');\"");
foreach (string s in n)
listViewGoogleInsight.Items.Add(new ListViewItem(s));
string[] u = getBetweenAll(site, "<td class=\"trends-hbars-value\">", "</td>");
foreach (var greeting in u)
{
var item = new ListViewItem();
item.SubItems.Add(greeting);
listViewGoogleInsight.Items.Add(item);
}
It’s been a long time since I used a ListView, but I think something like this would do what you want…
If that doesn’t do it exactly, read up on the
SubItemsproperty – it’s probably what you need to know about.EDIT: Assuming the rows have already been added, try this loop instead…