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.
 

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

Back
Top