There are many articles on the web about using attached behaviors for bringing a selected item into view (one such article is at
http://www.codeproject.com/KB/WPF/AttachedBehaviors.aspx). I've been trying this technique to implement error navigation in an application (like double clicking on an error in VisualStudio)
but I'm hitting a problem.
While it works great when you click on a visible row, it doesn't work if the selected row is offscreen, since the DataGrid's VirtualizedStackPanel is virtualized, so the row container wouldn't have been created.
I know that setting the DataGrid's VirtualizingStackPanel.IsVirtualized property to false will solve this problem (since it forces all DataGridRow containers to be created) but it ruins my application's performance. Is there another way to handle this
so I can programmatically scroll to DataGridRows that are offscreen (and don't yet have containers)? In the worst case, perhaps a way to calculate where the row "would" be if I knew the row's index?
View Complete Post