I am currently writing a method to reverse the selected rows in the RadGridView. My code looks like this
void RadMenuItemReverseSelection_Click(object sender, RoutedEventArgs e)
ObservableCollection<object> savedSelectedItems = DataGridList.SelectedItems;
foreach (object o in (System.Collections.ObjectModel.ObservableCollection<Site>) DataGridList.ItemsSource)
if (savedSelectedItems.Contains(o) == false) DataGridList.SelectedItems.Add(o);
if (DataGridList.SelectedItems.Count != 0) DataGridList.CurrentItem = DataGridList.SelectedItems;
But when we are adding the items to the selected items in the for loop its becomes very slow. (It actually hangs the UI on me test page as there are about 5000 rows to select.) The SelectAll and SelectNone methods on the grid are a lot quicker though (even with the 5000 of rows). So I was wondering is there a way to load the selected items collection quickly?
On a side note is it possible to display the Asynchronus animation from a call in the code behind. As I would quite like to display the working message when I am waiting of the data being returned from the service call and when we invert the selection.