"Terry Olsen" <to******@hotmail.comwrote in message
news:ex**************@TK2MSFTNGP02.phx.gbl...
How can i tell if a row in my DataGridView has been edited? I'm loading a
DataTable with ID3 information from MP3 files and using that as the
datasource for the DataGridView. I'm letting the user edit the information
in the grid and when the user has finished, he clicks the "Update" button.
Then I update the ID3 information in each MP3 file with the data from the
grid. However, if the grid has hundreds of files in it, this can take a
while.
I'd like to only update a file if its information has been edited. I
didn't find a property like "IsRowDirty" for the grid.
Thanks for any help.
Is there a Changed or TextChanged event for the DataGridView?
A method I used in a project could be adapted here, you add a 0 width column
to the DataGridView when you create it.
If the row is changed, set it to have a value, then later on when you save,
hack through the DataGridView.
If the flag column has a value, save it; if not, don't.
Another approach would be to store the original value in the flag column
when you populate the DataGridView.
Check that the 2 are the same when you go to save, if not, it's changed...
It would be harder in this case, as you're comparing several bits of
information for a change, but we can work round this.
If you have Column1, Column2 & Column3, Flag could contain
Column1|Column2|Column3, and we can play like that.
It would help, of course, if the delimiter is something that is illegal in
IDv3.
Hope some (or even better, all) of this helped.
--Paul Evans
SHL Computing