Saturday, February 3, 2018

How to clear Datagridview

There is two ways to clear rows in datagridview :



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()
 

 

No comments:

Post a Comment