title: Adding data from dataset to datagridview table takes long time
body: <p>I am trying to assign large data ( about 230,000 row x 16 column ) from dataset to datagridview in a winform and it takes a very long time to be loaded in the datagridview.</p>
  
  <p>After searching the web about this problem I found two solution to speed up the loading process, one using the virtualmode for the datagridview and the other solution by directly assigning the dataset to the datagridview datasource.</p>
  
  <p>Both solution are working but still take a long time, as the 1st solution takes about 15 mins to be completed while the 2nd solution takes about 30 mins.</p>
  
  <p>So I listed below the 2 solutions in order to check that I didn't miss something or maybe there is another solution for this issue.</p>
  
  <p>1st solution</p>
  
  <pre><code>    public Form1()
      {
          InitializeComponent();
          this.dataGridView1.Dock = DockStyle.Fill;
          this.Controls.Add(this.dataGridView1);
          this.Load += new EventHandler(Form1_Load);   
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          this.dataGridView1.VirtualMode = true;
          this.dataGridView1.CellValueNeeded += new
          DataGridViewCellValueEventHandler(dataGridView1_CellValueNeeded);
  
          DataSet DSg = ACC_Data.Get_DT(File_Path.Text.ToString());
  
          for (int i = 0; i &lt; DSg.Tables[0].Columns.Count; i++)
          {
          this.dataGridView1.Columns.Add(DSg.Tables[0].Columns[i].ColumnName, DSg.Tables[0].Columns[i].Caption);
          }
  
          this.dataGridView1.RowCount = DSg.Tables[0].Rows.Count;
  
      }
  
      private void dataGridView1_CellValueNeeded(object sender,
          System.Windows.Forms.DataGridViewCellValueEventArgs e)
      {
          if (e.RowIndex == this.dataGridView1.RowCount - 2 &amp;&amp; e.ColumnIndex == 0)
          {
              return;
          }
  
          e.Value = DSg.Tables[0].Rows[e.RowIndex][e.ColumnIndex];
      }
  </code></pre>
  
  <p>2nd Solution</p>
  
  <pre><code>    public Form1()
      {
          InitializeComponent();
          this.dataGridView1.Dock = DockStyle.Fill;
          this.Controls.Add(this.dataGridView1);
          this.Load += new EventHandler(Form1_Load);   
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          DataSet DSg = ACC_Data.Get_DT(File_Path.Text.ToString());
          this.dataGridView1.DataSource = DSg.Tables[0];
      }
  </code></pre>
  
  <p>Thanks in advance.</p>