12
Reply

Convert dataGridView to dataTable

garuka

garuka

Sep 17 2009 10:34 AM
88.4k
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 (12)