DataGridView not refreshing when new rows added

S

Steve

I have a bound DataGridView. When I add an item to the DataSource, the
DataGridView won't reflect the new row. I have googled and googled, no
solution that I have found online works. One thing that did work (sorta)
was this:
<code>
object tmp = dataGridView1.DataSource;
dataGridView1.DataSource = null;
dataGridView1.DataSource = tmp;
</code>

That is ugly code and I'm not happy about it. Another thing is that after I
run the above code, all the items are bound in the reverse order, isn't that
weird? ;)
Anyway, Refresh(), EndUpdate() Parent.Refresh() - none of that works. Is
this a known bug? Anyone have a trick?

Thanks,
Steve
 

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