So, I have a list as indicated in the title of the question. I have two columns installed: the name and date are changed. They were added to the constructor, here is the code emitted by the designer for reference:
// lstFiles this.lstFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.clmName, this.clmDate}); // ... // clmName this.clmName.Text = "Name"; this.clmName.Width = 105; // clmDate this.clmDate.Text = "Modified"; this.clmDate.Width = 128;
In the designer, it looks beautiful.
The list items themselves are a tiny subclass of ListViewItem that simply extracts some metadata from the file (in this case, the modified date) and adds the subitem to itself:
class GalleryItem : ListViewItem { public string File; public DateTime DateModified; public GalleryItem(string file) : base(Path.GetFileNameWithoutExtension(file)) { this.ImageKey = Path.GetExtension(file); File = file; DateModified = System.IO.File.GetLastWriteTime(file); this.SubItems.Add(DateModified.ToString()); } }
To add items to the list, I just do this:
lstFiles.BeginUpdate(); lstFiles.Clear(); foreach (String f in files) { ListViewItem lvi = new GalleryItem(f); lvi.Group = lstFiles.Groups["grpFiles"];
So, all this is great for viewing a large icon, etc .:

However, it is broken down into a detailed view:

There are elements in the list (there is a scroll bar). If you click roughly in the column under the red arrow (added with paint), you select the item (the upper right area is a preview of the image), but you will not see anything that would be selected.
So what am I doing wrong?