title: How to refresh Datagridview in vb.net
body: <p>In my VB.net win form application, when I clicked Load button I am displaying a filename from a folder onto a Datagridview. Then after I click on Process button the file will be moved to another folder. After file has been moved, Grid has to be refreshed.</p>
  
  <p>Here is the code i have written. I can able to move the file but not refreshing the Grid.Any suggestions please?</p>
  
  <pre><code> Public Class Form1
   Private Sub Load_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Load.Click
  
      With DataGridView1
          .Columns.Add("Column 0", "TaskName")
          .AutoResizeColumns()
      End With
  
      Dim rowint As Integer = 0
  
      'Dim directoryInfo As New System.IO.DirectoryInfo("C:\Users\Desktop\auto")
      'Dim fileInfo = System.IO.Directory.GetFiles(directoryInfo.ToString)
      'Dim name As String
  
      DataGridView1.Rows.Add()
      Dim filename As String = System.IO.Path.GetFileName("C:\Users\Ram\Desktop\auto\INQUEUE\123.txt")
      DataGridView1.Item(0, rowint).Value = filename
      rowint = rowint + 1
  
  End Sub
  
  Private Sub Process_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Process.Click
      System.IO.File.Move("C:\Users\Ram\Desktop\auto\INQUEUE\123.txt", "C:\Users\Ram\Desktop\Demo\abc.txt")
      System.IO.File.Delete("C:\Users\Ram\Desktop\auto\INQUEUE\123.txt")
      DataGridView1.Refresh()
  End Sub
  </code></pre>
  
  <p>End Class</p>