garuka

garuka

  • NA
  • 26
  • 0

Convert dataGridView to dataTable

Sep 17 2009 10:34 AM
I have a method which returns a dataTable and I use that to populate a dataGridView which works fine.
Then I want to capture the situation where user did modifications to that dataGridView (add new recs, delete, updates).
So what I tried is this
DataTable dt = (DataTable) dataGridView1.DataSource;
but everytime dt returns as null.

Any idea how to fix this?

Answers (13)