There is two ways to clear rows in datagridview :
1- When the datagridview is not assigned to Datasource :
2- When the datagridview isassigned to Datasource :
1- When the datagridview is not assigned to Datasource :
DataGridView1.Rows.Clear()
2- When the datagridview isassigned to Datasource :
DataGridView1.DataSource = Nothing
DataGridView1.DataMember = Nothing
DataGridView1.Refresh()