Datagridview -- Won't Clear

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top