A
Anders
Hi again,
I have two classes Form1 and GenData. Form1 creates an instance of genData.
genData populates a Datatable and then sends it to Form1 using the event
seen below:.
private void updateDatagrid(object sender, DataTable dt)
{
if ( dataGrid1.InvokeRequired )
{
dataGrid1.Invoke(new DataGridEventHandler(this.updateDatagrid));
}
else
{
dataGrid1.DataSource = dt;
}
}
The issue is, that when this event is called from a System.Timers.Timer
event (in genData) the datagrid is not filled. However, when I call the
event manually it works fine. As you can see above I tried to decipher the
inner workings of Invoke but it hasnt helped.
This is a windows app .Net 1.1 framework.
I have been strugling with this strange issue all day, I hope someone can
help.
Thanks,
Anders
I have two classes Form1 and GenData. Form1 creates an instance of genData.
genData populates a Datatable and then sends it to Form1 using the event
seen below:.
private void updateDatagrid(object sender, DataTable dt)
{
if ( dataGrid1.InvokeRequired )
{
dataGrid1.Invoke(new DataGridEventHandler(this.updateDatagrid));
}
else
{
dataGrid1.DataSource = dt;
}
}
The issue is, that when this event is called from a System.Timers.Timer
event (in genData) the datagrid is not filled. However, when I call the
event manually it works fine. As you can see above I tried to decipher the
inner workings of Invoke but it hasnt helped.
This is a windows app .Net 1.1 framework.
I have been strugling with this strange issue all day, I hope someone can
help.
Thanks,
Anders