Search code examples
c#.netwinformsbindingsource

Using a BindingSource, how do I tell if I have changes pending?


I am using a BindingSource in a WinForms project that edits a simple table on a SQL server. I want the "Save" icon to light up when the user tabs off a field if he has changed it. I have tried the HasChanges() method of the DataSet, but this returns false after I have made a change.

How do I tell if the user has changed something?


Solution

  • My problem was that I needed to call EndEdit() from the BindingComplete event. After doing that, HasChanges() (as well as Pete's RowState suggestion) worked.