I have a listview with 2 columns that puts the text taken from a textbox in the first column and the value of a radiobutton in the second one. Upon pressing the "add" button the text and the value appear in the listview, and the text is also added to a combobox.
Expand|Select|Wrap|Line Numbers
- ListViewItem lvi3 = new ListViewItem(textBox3.Text);
- //now adding the radiobutton value
- lvi3.SubItems.Add(textfromradiobutton);
- //refreshing the list
- listView3.Items.Add(lvi3);
- //adding the text from textbox to the combobox
- comboBox1.Items.Add(textBox3.Text);
Expand|Select|Wrap|Line Numbers
- private void usuńRekordToolStripMenuItem2_Click(object sender, EventArgs e)
- {
- if (listView3.SelectedItems.Count != 0)
- {
- foreach (ListViewItem lvi3 in listView3.SelectedItems)
- lvi3.Remove();
- }
- }