I am working in WinForms application and used DataGridView control in my application. Initially,i have loaded the 10000 rows and 50 columns in it. My scenario is that updating the datasource at particular time interval(using Timer).
Problem: The grid has been frozen/gang when performing the action(cell_click, scrolling, etc) while updating the datasource.
How to resolve this issue? Is there any work-around? Please suggest me your ideas.
Here is my code so far:
private void timer1_Tick(object sender, EventArgs e)
{
//try
{
timer.Stop();
for (int i = 0; i < 10000; i++)
{
var row = r.Next() % 10000;
for (int col = 1; col < 10; col++)
{
var colNum = r.Next() % 55;
if (table != null)
table.Rows[row][colNum] = "hi";// r.Next().ToString();
}
}
table.AcceptChanges();
timer.Start();
}
}
Here is an sample output:
[https://drive.google.com/open?id=0B9MOGv1FOt-TQ1BNZWtnRktxeXc]
Thanks.