BindingSource/Custom Object need HasChanges method

T

timnels

I have a custom business object that implements INotifyPropertyChanged
and IEditableObject. The collection of these objects inherits from
BindingList<T>. I created a BindingSource from which a grid (list of
objects) and a detail groupbox where bunch of textboxes are bound to
them.

Problem is I need to detect 2 things:

1. A way to know the current record is dirty (meaning any bound
property has changed), so I can enable/disable the Save and Cancel
toolbar buttons.

2. If the user changes data in the detail box and (without saving)
moves to another row in the grid, ask them if they want to update or
cancel the edit.

I know DataSet have several events and methods (like HasChanges), but
I don't know how to handle this when I am binding to a custom object.

Thanks for your help!
 
T

timnels

I have a custom business object that implements INotifyPropertyChanged
and IEditableObject. The collection of these objects inherits from
BindingList<T>. I created a BindingSource from which a grid (list of
objects) and a detail groupbox where bunch of textboxes are bound to
them.

Problem is I need to detect 2 things:

1. A way to know the current record is dirty (meaning any bound
property has changed), so I can enable/disable the Save and Cancel
toolbar buttons.

2. If the user changes data in the detail box and (without saving)
moves to another row in the grid, ask them if they want to update or
cancel the edit.

I know DataSet have several events and methods (like HasChanges), but
I don't know how to handle this when I am binding to a custom object.

Thanks for your help!

I think I have the plague.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top