mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Catch & ignore InvalidOperationException when scrolling
* Fix for a crash report - this exception can be thrown sometimes if the window is really small.
This commit is contained in:
@@ -1658,13 +1658,20 @@ namespace renderdocui.Windows
|
||||
|
||||
private void ScrollToRow(DataGridView view, int r)
|
||||
{
|
||||
int row = Math.Max(0, Math.Min(r, view.RowCount - 1));
|
||||
|
||||
if (row < view.RowCount)
|
||||
try
|
||||
{
|
||||
view.FirstDisplayedScrollingRowIndex = row;
|
||||
view.ClearSelection();
|
||||
view.Rows[row].Selected = true;
|
||||
int row = Math.Max(0, Math.Min(r, view.RowCount - 1));
|
||||
|
||||
if (row < view.RowCount)
|
||||
{
|
||||
view.FirstDisplayedScrollingRowIndex = row;
|
||||
view.ClearSelection();
|
||||
view.Rows[row].Selected = true;
|
||||
}
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// this can happen when the window is too small, all we can do is ignore it.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user