I have a windows form containing a text box and datagridview. As soon as the text of the text field changes, the datagridview data source is updated. This is done by handling the TextChanged event in the text field and assigning the data source, for example, a new list. Typically, a new data source contains 1000 rows, a fairly large amount of data. In addition, querying the database to retrieve this list also takes a lot of time.
What surprises me is that if I type fast enough in the text box, then the datagrid pauses the rendering again and again, and it only gives the final result. He completely ignores the average results. This makes sense because the working UI thread is busy during consecutive text changes. But why can I still enter a text box?
- Textchange
- Data retrieval
- Updating DataGridView (no rendering / drawing)
- Textchange
- Data retrieval
- Updating DataGridView (no rendering / drawing)
- ... TextChange
- Data retrieval
- Updating DataGridView (final rendering / painting)
- Done.
It looks like the text box was in a different thread, but it is absolutely not. Does anyone know why?
source share