Why not just use a filter? If you use a DataTable as the DataSource for the DGV, it has a DefaultView property which supports the RowFilter property:
(MyDataGridView.DataSource as DataTable).DefaultView.RowFilter = string.Format("Title LIKE '%{0}%'", filterString);
Then each time they type a character, add it to the filter string and set the filter
If you have a lot of rows, use a timer set to 1/4 second, and set a timeout each time they type:
Timer updateFilter = new Timer();
updateFilter.Interval = 250;
updateFilter.Tick += UpdateFilter_Tick;
updateFilter.Start();
}
private void UpdateFilter_Tick(object sender, EventArgs e)
{
if (UpdateFilter >= DateTime.Now)
{
(ItemsDisplay.DataSource as DataTable).DefaultView.RowFilter = string.Format("Title LIKE '%{0}%'", TitleFilter.Text);
UpdateFilter = DateTime.MinValue;
}
}
private void TitleFilter_TextChanged(object sender, EventArgs e)
{
if (sender is TextBox filter)
{
UpdateFilter = DateTime.Now.AddMilliseconds(500);
}
}