views:

84

answers:

0

I made a listviewitem. It's a list of files in chosen folder. I want to show what's in every file in another listview (these files contain tags and i want to show them in list). I used "Listviewitem.checked" or "listviewitem.selected" but it doesn't work. Why?

oh, sorry, here is the code:

AcrNemaFile file = null;

foreach (string element in files_in_folder)
{
    ListViewItem str = new ListViewItem(element);
    try
    {
        if (DicomFile.IsDicomFile(element))
        {
            file = new DicomFile(element, false);
            str.Text = element;
            listView1.Items.Add(str.Text);
        }
        if (DicomFile.IsDicomFile(element) && str.Checked)
        {
            Sequence sq = file.GetJointDataSets().GetJointSubsequences();
            string tag = "";
            string description = "";
            foreach (DataElement elementy in sq)
            {
                tag = elementy.Tag.ToString();
                description = elementy.VR.Tag.GetDictionaryEntry().Description;
                ListViewItem ite = new ListViewItem(tag);
                ite.Text = (tag + " " + description);
                listView2.Items.Add(ite.Text);
            }
        }
        else if (AcrNemaFile.IsAcrNemaFile(element))
        {
            file = new AcrNemaFile(element, false);
            textBox1.Text = file.ToString();
        }
        else
            textBox1.Text = "checked file" + element + "this is not a dicom file";
    }
    catch (Exception dicomexception)
    {
        label1.Text = ("Problems with processing this file " +dicomexception);
        return;
    }  
}