Hide some columns of listview

  • Thread starter Thread starter Guest
  • Start date Start date
You can´t really, or not easily (you should have to set the width to 0 and
prevent the user resizing it with some API calls/notifications). If you need
to hold extra data for each listitem that you don´t want to show, you can
create a class that derives from ListViewItem, add the extra property,
create instances of it, and add them to the listview.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
 
A simpler way is to create a class/structure to hold the data and then store
instances of that class in the ListViewItem.Tag property

/claes
 
Hi Claes,

I don´t like to store things in the Tag property because it is not clear
what that bag can contain since it is declared as Object and if you have to
declare a separate class anyway to hold the data (more than one value) it is
better to use inheritance, IMO.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
 
Back
Top