How can I tell if any cell in a grid has been changed?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BMackKC
    New Member
    • Dec 2006
    • 1

    How can I tell if any cell in a grid has been changed?

    I have an editable data-bound datagrid. I have an update routine, called by a button, which spins through the grid, and if the row state is modified, updates/inserts records as needed.

    I want to add a routine when the form closes that will prompt the user to save changes if any have been made.

    I thought I was on to something using HitTest, but ran into a wall there. Pity the datagrid documentation isn't better.

    I'm using VS2003, .NET framework 1.1

    Thanks for any advice, options, or code.

    Mike
  • programmerboy
    New Member
    • Jul 2007
    • 84

    #2
    Originally posted by BMackKC
    I have an editable data-bound datagrid. I have an update routine, called by a button, which spins through the grid, and if the row state is modified, updates/inserts records as needed.

    I want to add a routine when the form closes that will prompt the user to save changes if any have been made.

    I thought I was on to something using HitTest, but ran into a wall there. Pity the datagrid documentation isn't better.

    I'm using VS2003, .NET framework 1.1

    Thanks for any advice, options, or code.

    Mike
    You can say the following

    if (dataset.HasCha nges)
    {
    //Do whatever you need to do.
    }

    Comment

    Working...