Silverlight DataGrid refresh problem
Posted
by Krimson
on Stack Overflow
See other posts from Stack Overflow
or by Krimson
Published on 2010-05-17T15:22:24Z
Indexed on
2010/05/18
12:50 UTC
Read the original article
Hit count: 622
Silverlight
|datagrid
Hi,
I have encountered a problem when I refresh the observable collection behind my Silverlight DataGrid (the DataGrid binds to a PagedCollectionView with an ObservableCollection as source).
When I clear the observable collection and add the new items to the collection the DataGrid repositions to the top. I want the DataGrid to keep the scroll position. This seems to somewhat happen if I remove the items in the collection one-by-one with the RemoveAt mehtod and the add the new items one-by-one. But why is there this difference between removing all the items at once with the Clear method and removing the items one-by-one with the RemoveAt method?
Best Regards, Jesper
© Stack Overflow or respective owner