Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to do simple form which should have a component (I am thinking about listbox) which displays "Product Name", "Product count" list. When you select product it is possible to change the count or remove the item from list. List data will be saved in text file.

My questions: what windows forms component I should use two display two column list?

How should I populate that component with items from file?
Posted

I would use a ListView[^] (in Details View).
There are many tutorials available, for instance you may look at "C# ListView Control"[^].
 
Share this answer
 
ListView or DataGridView can be ok for this. If I understood correctly, starting data is saved in text file? In that case, you can use DataTable to store data that will be shown, and you can change that data as needed (remove item from list, change count), and if you need, you can later go through DataTable, and write data back to your text file. You can use StreamReader to read data from text file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900