Clear data in DataGridView

H

Huy Nguyen

Hello all
I've been trying to do a little project here and i am stuck at the
point where I can not clear the data out of datagridview table. I've done
lots of reading from different sources on internet. Most of the suggestion
is put this line of code in > DataGridView1.Rows.Clear() < This line
never work and if give me and ArgumentException Error. Could any one please
help me out. I am using vb 2005. Thanks
HN
 
C

Cor Ligthert[MVP]

Huy,

A datagridview is normally accessed by its underlying datatable. If you
clean that than it is empty. Or even more simple.

DataGridView1.datasource = nothing

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top