how can one empty-out DataGridView1 object?

  • Thread starter Thread starter Joe
  • Start date Start date
Is your DataGridView bound to a data source? or are you filling it
manually?

Robin S.

data source!! I never use it "manually". I just (after all day) want
to clear this window out...
 
Joe said:
data source!! I never use it "manually". I just (after all day) want
to clear this window out...

Assuming you're using .Net 2.0, try using a Binding Source.

Dim myBindingSource as BindingSource = New BindingSource()

myBindingSource.DataSource = myDataSet.Tables(0)
myDataGridView.DataSource = myBindingSource

Then see what happens when you clear your dataset (set it to nothing). The
BindingSource handles the link between the data and the display, it's kind
of like lubrication between gears. It responds immediately to changes in
the data source.

Robin S.
 
Back
Top