title: Datagridview optimization VB.Net
body: <p>I just want to ask if there is another alternative for filling up the cells in the datagridview. Currently I'm using this code :</p>
  
  <p>For i = DataGridView1.CurrentCell.RowIndex To x - 1</p>
  
  <pre><code>        DataGridView1.Rows(i).Cells("LastName").Value = empcoll.Item(i).LastName
          DataGridView1.Rows(i).Cells("FirstName").Value = empcoll.Item(i).FirstName
          DataGridView1.Rows(i).Cells("MiddleName").Value = empcoll.Item(i).MiddleName
          DataGridView1.Rows(i).Cells("CreatedBy").Value = empcoll.Item(i).CreatedBy
          DataGridView1.Rows(i).Cells("CreateDate").Value = empcoll.Item(i).CreateDate
          DataGridView1.Rows(i).Cells("Status").Value = empcoll.Item(i).Status
          DataGridView1.Rows(i).Cells("DailySalary").Value = empcoll.Item(i).DailySalary
          DataGridView1.Rows(i).Cells("BirthDate").Value = empcoll.Item(i).BirthDate
  
  
  
      Next i
  </code></pre>
  
  <p>but when I use it for databases with a large number of records, it tends to load slow and hangs up.</p>