Datagridview -- Won't Clear

G

Guest

I have a DGV (vb.net 2005). The user has the option to search by City,
State, Name...etc.

I can't get the DGV to clear between searches. The first search (city for
example) works fine. But if I change it to State...the results are
correct...but the City column still exists and the State Column has been
added to the end.

I've tried clearing rows, columns, and setting the datasource to nothing
before starting again...but the DGV seems to retain the previous column
settings.

Any suggestions?

Arne
 
R

RobinS

Bind it to a binding source. Then when you change the data source, the
Binding Source will handle the changes to the grid.

myBindingSource.DataSource = myTable
myDGV.DataSource = myBindingSource

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
 

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