I need to move items from one listbox to another listbox on button click event in silverlight Application.
I use the follow code,
private void Button_Click_1(object sender, RoutedEventArgs e)
{
ListBox2.Items.Add(ListBox1.SelectedItem);
if (ListBox2.SelectedIndex != -1)
{
ListBox1.Items.Add(ListBox2.SelectedValue);
ListBox2.Items.Remove(ListBox2.SelectedValue);
}
}
But If I try to use that above code it give the following Error,
operation not supported on read-only collection
How can solve this problem ??