R
Rich P
I need to pass a list to a backgroundworkder - specifically from a
listview control. I have attempted the following:
List<ListView> myLvw
foreach(ListViewItem lvw in ListView1)
myLvw.Add(lvw)
but this is not working. I need to create a list that will contain the
equivalent contents of ListView1. How can I do this? I also tried
passing ListView1 to the background worker but got a crossthread error
message.
here is the basic scenario:
...btn1_Click(...)
{
//populate a listview control
//create a list that is equivalent to the listview control
//call backgroundworker(list)
}
...backgroundWorker1_DoWork(...)
{
List<ListView>myLvw = <ListView>e.Argument;
...
}
Is it possible to pass a listview type list to the backgroundworker or
should I just create and dimension a multi-dimensional string array to
pass to the backgroundworker?
Thanks,
Rich
listview control. I have attempted the following:
List<ListView> myLvw
foreach(ListViewItem lvw in ListView1)
myLvw.Add(lvw)
but this is not working. I need to create a list that will contain the
equivalent contents of ListView1. How can I do this? I also tried
passing ListView1 to the background worker but got a crossthread error
message.
here is the basic scenario:
...btn1_Click(...)
{
//populate a listview control
//create a list that is equivalent to the listview control
//call backgroundworker(list)
}
...backgroundWorker1_DoWork(...)
{
List<ListView>myLvw = <ListView>e.Argument;
...
}
Is it possible to pass a listview type list to the backgroundworker or
should I just create and dimension a multi-dimensional string array to
pass to the backgroundworker?
Thanks,
Rich