Hey I have a question.. I have a list in one form that looks like this:
[column1] - [column2]
item1 - 0
item2 - 6
item3- 8
item4 - 5
item5 - 2
soo.. now I open a new form and I need to select what kind of items I want from column 2.
So I select from 2 to 7.
So I select (in theory) item2, item4 and item5 from my listview from another form.
Here's the code I have:
private void button1_Click(object sender, EventArgs e)
{
var from = numericUpDown1.Value;
var to = numericUpDown2.Value;
using (Form5 form5 = new Form5())
{
List<string> urls = new List<string>();
foreach (ListViewItem item in form5.listView1.Items)
{
foreach (ListViewItem.ListViewSubItem sub in item.SubItems)
{
if (String.Equals("0", sub.Text))
{
urls.Add(item.Text);
}
}
}
string[] items = urls.ToArray();
foreach (string i in items)
{
MessageBox.Show(i.ToString());
}
}
}
But it doesn't work.. it doesn't show items that have "column2" as 0.
Please help me out.