Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1140
DataChanged property of a cell
posted

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

 

  • 469350
    Suggested Answer
    Offline posted

    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.