Skip to content

Commit 607b176

Browse files
committed
after sorting columns: scroll view to selected row
1 parent 1325a1e commit 607b176

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,6 @@ void SortHandlerUpdates(object sender, DataGridSortingEventArgs e)
30873087
{
30883088
DataGridColumn column = e.Column;
30893089

3090-
30913090
IComparer comparer = null;
30923091

30933092
// prevent the built-in sort from sorting
@@ -3179,6 +3178,14 @@ void SortHandlerRecentProjects(object sender, DataGridSortingEventArgs e)
31793178

31803179
//apply the sort
31813180
lcv.CustomSort = comparer;
3181+
3182+
if (gridRecent.SelectedItem != null)
3183+
{
3184+
// scroll view to selected, after sort
3185+
gridRecent.ScrollIntoView(gridRecent.SelectedItem);
3186+
// needed for keyboard to work in grid
3187+
gridRecent.Focus();
3188+
}
31823189
}
31833190

31843191
public class CustomProjectSort : IComparer

0 commit comments

Comments
 (0)