示例#1
0
 private void SetWatchGridDataSource(DataSet ds)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.dataGridView1.InvokeRequired)
     {
         SetDatasource d = new SetDatasource(SetWatchGridDataSource);
         this.Invoke(d, new object[] { ds });
     }
     else
     {
         this.dataGridView1.AutoGenerateColumns = true;
         this.dataGridView1.DataSource          = ds;
         this.dataGridView1.DataMember          = ds.Tables[0].TableName;
         this.dataGridView1.Refresh();
     }
 }
示例#2
0
 private void SetWatchGridDataSource( DataSet ds )
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.dataGridView1.InvokeRequired)
     {
         SetDatasource d = new SetDatasource ( SetWatchGridDataSource );
         this.Invoke ( d, new object[] { ds } );
     }
     else
     {
         this.dataGridView1.AutoGenerateColumns = true;
         this.dataGridView1.DataSource = ds;
         this.dataGridView1.DataMember = ds.Tables[0].TableName;
         this.dataGridView1.Refresh ();
     }
 }