data change notification

R

Rick

I developing a large project that will have numerous text boxes, datetime
controls, checkboxes etc. all data bound to a
dataset/datatable/tableadapter.

I'm wondering what is the normal way to get notification from the program
that the user has changed some databound item? I know I can tap into the
OnChange event of all these individual controls, however it seems like there
should be something exposed at a more common level.

I looked at data table RowChanging, ColumnChanging events but they don't
trigger until I have updated the data. I want to know when the client makes
a change so I can enable a "Save your changes" button or similar.

Any suggestions?

Rick
 
E

EMartinez

I developing a large project that will have numerous text boxes, datetime
controls, checkboxes etc. all data bound to a
dataset/datatable/tableadapter.

I'm wondering what is the normal way to get notification from the program
that the user has changed some databound item? I know I can tap into the
OnChange event of all these individual controls, however it seems like there
should be something exposed at a more common level.

I looked at data table RowChanging, ColumnChanging events but they don't
trigger until I have updated the data. I want to know when the client makes
a change so I can enable a "Save your changes" button or similar.

Any suggestions?

Rick

It really depends on the specific controls used; since it is on a
control-by-control basis. There are several event handlers available
per type of control that can provide relatively good flexibility in
event capturing.

Regards,

Enrique Martinez
Sr. Software Consultant
 
G

Guest

I'm wondering what is the normal way to get notification from the
program that the user has changed some databound item? I know I can
tap into the OnChange event of all these individual controls, however
it seems like there should be something exposed at a more common
level.

The standard controls don't have a standard event.

However, if you build your own classes/controls, I believe you can
implement INotifyPropertyChanged:

http://msdn2.microsoft.com/en-
us/library/system.componentmodel.inotifypropertychanged.aspx

Otherwise if you're checking to see if a record has changed, you could just
check a timestamp. If the timestamp is not the same as the one in the
record, then you can assume the record has changed.
 
R

Rick

Thanks everyone.

To me it seemed like this would be something built into the net framework
since notifications for this type of change to data can't bee all that rare,
however...

Perhaps it is just my programming background having used Delphi and
IBObjects where data changes sent out a notification event and could
optionally change colors (like light blue for edit mode) to all the controls
that were attached to the data table.

I guess I'll have to do my homework and roll my own if I want this type of
thing.

Rick
 

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