This question is locked. New answers and comments are not allowed.
2008Q2
If I move ListBoxItem objects from one Listbox to the other, for example with
code like that:
listbox1.Items.AddRange(listBox2.SelectedItems.ToArray())
and then remove those items from list box 2:
foreach(RadListBoxItem item in litstbox1.Items)
{
if(listbox2.Items.Contains(item))
{
listbox2.Items.Remove(item)
}
}
strange things happen. I can no longer select the moved nodes in listbox1 (even though the texts appear).
I guess a RadListBoxItem cannot be in two listboxes at the same time (but then, an Exception should be thrown).
I tried to avoid this by using an intermediate List<RadListBoxItem>, but this did not work either.
Finally ended up with creating code like this:
foreach(RadListBoxItem in listbox2.SelectedItems)
{
listbox1.Add(new RadListBoxItem(item.Text,item.Value))
}
which works but IMHO is not very elegant.
BTW: The forum does not work well with latest versions of Firefox.
If I move ListBoxItem objects from one Listbox to the other, for example with
code like that:
listbox1.Items.AddRange(listBox2.SelectedItems.ToArray())
and then remove those items from list box 2:
foreach(RadListBoxItem item in litstbox1.Items)
{
if(listbox2.Items.Contains(item))
{
listbox2.Items.Remove(item)
}
}
strange things happen. I can no longer select the moved nodes in listbox1 (even though the texts appear).
I guess a RadListBoxItem cannot be in two listboxes at the same time (but then, an Exception should be thrown).
I tried to avoid this by using an intermediate List<RadListBoxItem>, but this did not work either.
Finally ended up with creating code like this:
foreach(RadListBoxItem in listbox2.SelectedItems)
{
listbox1.Add(new RadListBoxItem(item.Text,item.Value))
}
which works but IMHO is not very elegant.
BTW: The forum does not work well with latest versions of Firefox.