I need to display lots of rows in a grid added at a pretty high frequency (up to 10 rows per second in some cases) I chose ListView because I assume is the fastest grid cont
Instead of using ObservableCollection I will suggest BindingList class, you can do something like this..
BindingList<string> list = new BindingList<string>();
list.AllowEdit = true;
list.AllowNew = true;
list.AllowRemove = true;
// set the list as items source
itemCollection.ItemsSource = list;
// add many items...
// disable UI updation
list.RaiseListChangedEvents = false;
for each(string s in MyCollection){
list.Add(s);
}
// after all.. update the UI with following
list.RaiseListChangedEvents = true;
list.ResetBindings(); // this forces update of entire list
You can enable/disable updating even in batches, instead of adding everything at one shot, BindingList has been functioning better then ObservableCollection in all my UI, I wonder why everywhere people talk more about ObservableCollection when BindingList really superseds ObservableCollection.