Basic C# DataGridView question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MKBender
    New Member
    • Oct 2006
    • 6

    Basic C# DataGridView question

    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
  • milonov
    New Member
    • Oct 2006
    • 32

    #2
    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/frlrfsystemdata datatableclassr owchangedtopic. asp

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

    Originally posted by MKBender
    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

    Comment

    • MKBender
      New Member
      • Oct 2006
      • 6

      #3
      Thanks for the reply, for some reason that event was never being thrown. So I decided to use the DataTable.CellV alueChanged event, and that works just fine.

      Thanks again,
      Matthew Bender

      Comment

      Working...