how can i remove multiple items from observablecollection in silverlight.in my project i have one datagrid populating more than one items.in every row contain one checkbox also.if i select more than one row by selecting checkbox and click delete button ,i want to delete all the item from the collection.
public void delete(object parameter)
{
foreach (var x in Book)
{
if (x.Ischeck == true)
{
Book.Remove(x);
}
}
}
it cause error.can’t change observablecollection
You can use below mentioned code snippet instead:
OR