I have a Datasource which can trigger an event in order to sent data to a DataGridView. The event is triggered max 10000 times in ~1 minute. After the minute no more events will be triggered.
An Event handler receives the data. Every time I receive data, a row should be added to a DataGridView showing the information from the DataSource.
For now i have got a backgroundworker which fills a DataTable. Inside the Backgroudworker i have something like this:
DataTable dt = new DataTable()
private void ReceivedData(object sender, SomeEventArgs e)
{
dt.Add(e.Data);
}
The problem is, that the DataGridView freezes during the process when working with more than ~300 rows. I thought about using the Virtual Mode but the problem is, that i dont know how many items i will receive and i can not count all the items before receiving them.
The goal is to show the items inside the DataGridView directly after receiving them.