0

I normally use ListBox but for my new UI I need columns. I moved to a ListView, set up five columns in the inspector, and then used this code to populate the list:

Dim TempI as ListViewItem
For Each P As Prop In PropsList.Values
    TempI = New ListViewItem(New String(4) {P.ExternalID, P.PropName, P.CityName, P.StateName, P.UserName})
    PropListView.Items.Add(TempI)
Next P

This produces a box with 14 columns instead of 5, displaying mostly the ExternalId's but a handful of PropName's as well. When I click on them, it selects only a single cell, rather than the entire line, even though it is set to select a line. It seems that it has been put into some sort of "fit to screen" mode like a directory set to small icons as opposed to details. The following image shows the problem:

enter image description here

I check in debugger, I do have 5 columns and they seem to have the right info, and the Items seem to have the property number of entries, 280. All five values are defined for all items. Is there something I have to do to get the columns to work?

I am using the code found here, converted to VB. I found an example on Sam Jenkins, and tried a few variations, but I keep having this result. I also tried both String() and String(4).

Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98

0 Answers0