I need to create a list view with 3 columns, but I need also 2 more columns with related data that should not be viewed. Is there a way to do this?
Thank you.
Is there a way to create an invisible column in a ListView?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sam HobbsRank #107 · 20.5K reputationPosted Apr 12, 2024, 10:34 PM EDT
It depends very much on your data and other things. Typically a ListView shows items of a collection. You can set the ListView to not generate columns automatically, then bind the collection to the ListView and generate the columns explicitly that you want shown. Does that sound like what you need to do?
Ismael Oliveira163 reputationPosted Apr 14, 2024, 8:49 AM EDT
Hi, Sam. First I want to Thank you for your answer. Maybe it does not help me, because after the listview is populated, in another control I have to recover all the data of one specific line. If the data aren't in the listview will complicate.
Unless I'm not seeing what yoy mean. Can you detail?
Thanks again.
Sam HobbsRank #107 · 20.5K reputationPosted Apr 14, 2024, 9:26 AM EDT
You can use the control's
Selectedproperty to determine what the object or objects of the bound collection are (that are selected) and then you can access any of the items in the object of the bound collection.The
DataGridViewcontrol has more features than theListViewcontrol does. I suggest using aDataGridViewinstead.Ismael Oliveira163 reputationPosted Apr 15, 2024, 9:23 AM EDT
Hi, Sam. I'll try your suggestion.
Thanks.