By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,341 Members | 1,399 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,341 IT Pros & Developers. It's quick & easy.

Basic C# DataGridView question

P: 6
I'm pretty new to .net, so your help is very apprciated.

So I have a DataGridView that has a dataTable data source. This dataGridView is also editable. When a user tries to close an open data open or open a different data file, I would like to ask if the user wants to save his changes, but only if he made changes. I don't know how to detect if the user made changes to the datagridview

Is there a simple property part of the datagridview or maybe datatable, that might tell me this information?
Or do I need to setup an event handler for the first edit to the datagridview?

Thanks for you help,
Matthew
Oct 24 '06 #1
Share this Question
Share on Google+
2 Replies


milonov
P: 32
Hello, Matthew

You can catch DataRowChanged event of DataTable
for more information see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatatableclassrowchangedtopic.asp

Best Regards,
Michael Milonov
http://www.snotratech.com

Is there a simple property part of the datagridview or maybe datatable, that might tell me this information?
Or do I need to setup an event handler for the first edit to the datagridview?

Thanks for you help,
Matthew
Oct 24 '06 #2

P: 6
Thanks for the reply, for some reason that event was never being thrown. So I decided to use the DataTable.CellValueChanged event, and that works just fine.

Thanks again,
Matthew Bender
Oct 24 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.