I have two columns in my listView, lets call them Column1, and Column2.
Is it possible to add a bunch of items to column1 only, and make it so those items only go strictly under column1 and not column2?
When I add items it adds an item to Column1, and then Column2 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 column1 (each in their own row) and not under column2. When I test it, they still go under column1 AND column2 which is what I don’t want.
string[] h = {"Hi","Hello"};
listViewGoogleInsight.Items.Add(new ListViewItem(h));
Maybe this will help:
In your code you are passing a string array to the constructor of a
ListViewItemwhich is creating one ListViewSubitem of the “Hello”. You should add each string separately.EDIT: After your request to add only to column2 you can do it like this. You must pass empty string to for the first column because you need to make a ListViewItem for the first column and additional ListViewSubitems for every other column.