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.
Loading
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.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ismael OliveiraPosted Apr 15, 2024, 1:23 PM
Hi, Sam. I'll try your suggestion.
Thanks.
Sam HobbsPosted Apr 14, 2024, 1:26 PM
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 OliveiraPosted Apr 14, 2024, 12:49 PM
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 HobbsPosted Apr 13, 2024, 2:34 AM
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?