In my C # WPF application, I have one DataGrid, and right above it TextBox, so that the user can search and filter the grid as it is entered. If the user quickly picks up speed, the text will not be displayed until 2 seconds after they print, because the UI thread is too busy updating the grid.
Since most of the delay is all on the user interface side (i.e., filtering the data source is almost instantaneous, but restoring and re-rendering the grid is slow), multithreading did not help. Then I tried to set the dispatcher of that grid only to a lower level while the grid is being updated, but this also did not solve the problem. Here is some code ... Any suggestions on how to solve this problem?
string strSearchQuery = txtFindCompany.Text.Trim();
this.dgCompanies.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(delegate
{
dgCompanies.ItemsSource = oFilteredCompanies;
}));
source
share