Skip to content

Commit

Permalink
[BUG] Fix not scrolled to searched item (#398), version 1.2.9.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofknecht committed Jun 11, 2022
1 parent f5b29b4 commit 7afcb95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Business/Menus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void LoadMainMenuCompleted(object sender, RunWorkerCompletedEventArgs e)
}

AsEnumerable.ToList().ForEach(m => { m.ShowWithFade(); });
menus[0].ResetSearchText();
}
else
{
Expand Down Expand Up @@ -1028,8 +1027,7 @@ private void MenuVisibleChanged(object sender, EventArgs e)

if (menu.Level == 0)
{
DataGridView dgv = menu.GetDataGridView();
((DataTable)dgv.DataSource).DefaultView.RowFilter = "[SortIndex] LIKE '%0%'";
menu.ResetSearchText();
AdjustMenusSizeAndLocation();
}
}
Expand Down
6 changes: 5 additions & 1 deletion Business/WaitToLoadMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ private void SetData(DataGridView dgv, int rowIndex)
this.dgv = dgv;
this.rowIndex = rowIndex;
RowData rowData = (RowData)dgv.Rows[rowIndex].Cells[2].Value;
rowData.IsSelected = true;
if (rowData != null)
{
rowData.IsSelected = true;
}

dgv.Rows[rowIndex].Selected = false;
dgv.Rows[rowIndex].Selected = true;
}
Expand Down
2 changes: 2 additions & 0 deletions UserInterface/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ protected override CreateParams CreateParams
internal void ResetSearchText()
{
textBoxSearch.Text = string.Empty;
dgv.FirstDisplayedScrollingRowIndex = 0;
AdjustScrollbar();
}

internal void FocusTextBox()
Expand Down

0 comments on commit 7afcb95

Please sign in to comment.