There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
DataGrid SelectionChanged event fired many times when scrolling
If you scroll up/down with the mouse and you don't change the selected row(s) but the event will be fired as many times as many row you scrolled. In this case the event should not be fired.
If you scroll with keyboard and you use the page up/down keys, you jump a few rows and change the selection. In this case the event will be fire not only once but as many times as many rows you jumped.
This behaviour is a major performance issue if you have a longer task to do when you have the selection changed.
1, Create a DataGrid
2, Fill it with 100 rows
3, Make the DataGrid big enough to display 20 lines
4, Make the Vertical Scrollbar visible
5, Create a SelectionChanged event (you can put a Sleep() into the handler to feel the problem:)
6, Put a breakpoint into the event
7, Run the app
8, Select a row
9, Scroll with keyboard or mouse
I used the DataGrid of the June 2009 Toolkit, and also tried the DataGrid in build 29533 (November 2009).