Search code examples
delphidelphi-7vcltlistview

How to hide a column in TListview?


I am using a listview to store and show data. How can i hide and show a column in listview? Dont tell me to set the column width to 0 please!!!!


Solution

  • In the Delphi TListView you can't hide columns in vsReport view style. Your only option is to delete the column when you need to hide it, and create it again when you need to show it.

    This is yet another example of why virtual list views are much more desirable than non-virtual list views. With a virtual list view you can insert new columns without having to iterate across all items in the list and re-populate their sub items.