mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-09-21 03:41:30 +12:00
[BUG] Search reset sometimes not working (#303), version 1.2.2.12
This commit is contained in:
parent
968cf08a36
commit
9e65ec3143
2 changed files with 12 additions and 6 deletions
|
@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.2.11")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.11")]
|
||||
[assembly: AssemblyVersion("1.2.2.12")]
|
||||
[assembly: AssemblyFileVersion("1.2.2.12")]
|
||||
|
|
|
@ -779,10 +779,12 @@ namespace SystemTrayMenu.UserInterface
|
|||
like = $"LIKE '%{searchString}%'";
|
||||
}
|
||||
|
||||
bool isSearchStringEmpty = string.IsNullOrEmpty(searchString);
|
||||
|
||||
try
|
||||
{
|
||||
if (Properties.Settings.Default.ShowOnlyAsSearchResult &&
|
||||
string.IsNullOrEmpty(searchString))
|
||||
isSearchStringEmpty)
|
||||
{
|
||||
data.DefaultView.RowFilter = "[SortIndex] LIKE '%0%'";
|
||||
}
|
||||
|
@ -805,8 +807,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
}
|
||||
|
||||
string columnSortIndex = "SortIndex";
|
||||
|
||||
if (string.IsNullOrEmpty(searchString))
|
||||
if (isSearchStringEmpty)
|
||||
{
|
||||
foreach (DataRow row in data.Rows)
|
||||
{
|
||||
|
@ -852,7 +853,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
{
|
||||
RowData rowData = (RowData)row.Cells[2].Value;
|
||||
|
||||
if (!string.IsNullOrEmpty(searchString) || !rowData.ShowOnlyWhenSearch)
|
||||
if (!isSearchStringEmpty || !rowData.ShowOnlyWhenSearch)
|
||||
{
|
||||
rowData.RowIndex = row.Index;
|
||||
|
||||
|
@ -880,6 +881,11 @@ namespace SystemTrayMenu.UserInterface
|
|||
{
|
||||
timerUpdateIcons.Start();
|
||||
}
|
||||
|
||||
if (isSearchStringEmpty)
|
||||
{
|
||||
dgv.FirstDisplayedScrollingRowIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void PictureBox_MouseEnter(object sender, EventArgs e)
|
||||
|
|
Loading…
Reference in a new issue