The form which contains the grid has a save button. If the item within the grid changes then I am enabling the save button. I am checking the change of the cell value based on DataChanged property of the cell. But I have a little issue.
For Example if the original value is 250 and then when I change the cell value to 20 then save is enabled and again if i edit it back to 250 still the save is enabled. How can I avoid it.
I am using this to enable and disable the save button
For j As Integer = 0 To DailyProductionItemsGrid.Rows(i).Cells.Count - 1 If DailyProductionItemsGrid.Rows(i).Cells(j).DataChanged Then DataIsChanged = True End If End If End If Next
help me out
There's really no easy way to do this. I think you will find that most applications enable the "save" button once any change is made and they do not disable such a button when a user changes a value back to it's original value.
If you cancel the update on the row using the Escape key, then that's a different matter. But if you type the same value into a cell or a TextBox, most applications will still assume that something may have changed.