Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF DataGrid - maintain scroll position after refresh

Anyone knows how to maintain the vertical scroll position after the Refresh command?

My Datagrid receives binding from a List of objects.

Many thanks, and sorry for my english.

like image 784
Guilherme Avatar asked Nov 01 '12 01:11

Guilherme


1 Answers

2 posible solutions :

1) Try to update the list instead of replacing it. it means adding new items and removing items you don't need.

2) you can save the state of the scroller before refreshing and then scroll programmly to the selected item.

WPF Toolkit: how to scroll datagrid to show selected item from code behind?

like image 165
Erez Avatar answered Oct 06 '22 00:10

Erez