0

I have a ListView with 2 columns. When I click a ADD button, I want the first text to go to the first column, second text to the second column, but it's not working.

I am using Visual studio 2003, c# WPF.

listView1.View = View.Details;
ListViewItem lvwItem = listView1.Items.Add("TextBox1.Text");
lvwItem.SubItems.Add("TextBox2.Text");
LPLN
  • 475
  • 1
  • 6
  • 20
sahana
  • 15
  • 6
  • Hello. And welcome to StackOverflow. Please provide us with the example of what you've tried to do. – Gleb Dec 13 '19 at 05:28
  • Hello! Does your question answer this? https://stackoverflow.com/questions/17225675/add-text-from-textbox-to-listview-column –  Dec 13 '19 at 05:30
  • 1
    Does this answer your question? [add text from textbox to listview column](https://stackoverflow.com/questions/17225675/add-text-from-textbox-to-listview-column) – Natrium Dec 13 '19 at 05:35
  • I tried that code, but it's also not working.. View.Details and SubItems Property is not there. – sahana Dec 13 '19 at 05:38
  • Your provided code used windows form method, When your prj is WPF, thats why it doesnt work! – MarioWu Dec 13 '19 at 06:07
  • give me any code to add item to listview column – sahana Dec 13 '19 at 08:14

0 Answers0