Hi,
Is refreshdata invoked?
And you don't need a custom delegate - you might use MethodInvoker.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
"Montaque" <mo******@citiz.net> wrote in message
news:eI****************@TK2MSFTNGP12.phx.gbl...
//Refersh the datagrid automatically.however,the callback function test() is
not been invoked. any suggestions?
the following lists the code
private void AutoRefreshData()
{
System.Threading.Timer c=new System.Threading.Timer(new
TimerCallback(this.refreshdata),this,0,1000);
}
private void refreshdata(Object Data)
{
this.Invoke(new InvokeFormOwn(this.test));
}
private delegate void InvokeFormOwn();
private void test()
{
this.dataGrid1.DataSource=null;
this.dataGrid1.DataSource=OrderSystem.GetInstance( ).GetAllOrderItems();
}