Convert dataGridView to dataTable
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?