Listview layout probmems

06-10-2006, 12:40 AM
For some reason when I add items to my listview, they are added left to right. It is just a stock listview. Why would this happen?


06-10-2006, 05:33 AM
Change the View property to details or list.

06-12-2006, 07:15 PM
Change the View property to details or list.
Thanks, That worked. I do have one problem, however. I ckear the listview with:


After this, I create another listview in its place witht the same:


For some reason, it looses the view.small layout....even if I put it in the code after the clear(). Do you know what would cause this? Am I clearing the listview wrong?

Allen G
06-13-2006, 01:16 AM
Public Sub Clear()
Member of: System.Windows.Forms.ListView
Removes all items and columns from the control.

Public Overridable Sub Clear()
Member of: System.Windows.Forms.ListView.ListViewItemCollection
Removes all items from the collection.

So when using listView.Clear you're removing all of your columns aswell as your items. Basicly reseting it back to default.

What you want to use is listView.Items.Clear, which only removes the items and will preserve your column headers.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum