Removed unnecessary code.
This commit is contained in:
parent
6f184273b8
commit
235d0acede
@ -181,15 +181,15 @@ namespace LibationWinForms
|
|||||||
var productIds = searchResults.Docs.Select(d => d.ProductId).ToList();
|
var productIds = searchResults.Docs.Select(d => d.ProductId).ToList();
|
||||||
|
|
||||||
// https://stackoverflow.com/a/18942430
|
// https://stackoverflow.com/a/18942430
|
||||||
var currencyManager = (CurrencyManager)BindingContext[_dataGridView.DataSource];
|
var bindingContext = BindingContext[_dataGridView.DataSource];
|
||||||
currencyManager.SuspendBinding();
|
bindingContext.SuspendBinding();
|
||||||
{
|
{
|
||||||
for (var r = _dataGridView.RowCount - 1; r >= 0; r--)
|
for (var r = _dataGridView.RowCount - 1; r >= 0; r--)
|
||||||
_dataGridView.Rows[r].Visible = productIds.Contains(getGridEntry(r).AudibleProductId);
|
_dataGridView.Rows[r].Visible = productIds.Contains(getGridEntry(r).AudibleProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Causes repainting of the DataGridView
|
//Causes repainting of the DataGridView
|
||||||
currencyManager.ResumeBinding();
|
bindingContext.ResumeBinding();
|
||||||
VisibleCountChanged?.Invoke(this, _dataGridView.AsEnumerable().Count(r => r.Visible));
|
VisibleCountChanged?.Invoke(this, _dataGridView.AsEnumerable().Count(r => r.Visible));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,6 @@ namespace LibationWinForms
|
|||||||
|
|
||||||
protected override ListSortDirection SortDirectionCore => listSortDirection;
|
protected override ListSortDirection SortDirectionCore => listSortDirection;
|
||||||
|
|
||||||
protected override bool SupportsSearchingCore => true;
|
|
||||||
|
|
||||||
protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
|
protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
|
||||||
{
|
{
|
||||||
List<T> itemsList = (List<T>)Items;
|
List<T> itemsList = (List<T>)Items;
|
||||||
@ -57,20 +55,5 @@ namespace LibationWinForms
|
|||||||
|
|
||||||
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
|
OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override int FindCore(PropertyDescriptor property, object key)
|
|
||||||
{
|
|
||||||
int count = Count;
|
|
||||||
for (int i = 0; i < count; ++i)
|
|
||||||
{
|
|
||||||
T element = this[i];
|
|
||||||
if (property.GetValue(element).Equals(key))
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user