Data source on change

  • Thread starter Thread starter Tamir Khason
  • Start date Start date
T

Tamir Khason

I want to be able to fire event when the data source was changed
The data source is data objects in array list (which does not know to
notify)
Is it possible to use control's functionality (e.g. DataGrid) to catch the
update of data source (DG updates with add to data source)
 
Hi Tamir,

Thank you for posting in the community!

Based on my understanding, you use ArrayList as the datasource and bind
your datagrid to this datasource. You want to be notified when your
datasource was changed.

=================================================
If your datasource is datatable(or dataset), you can just use DataView
object to wrap it, and then you can use DataView.ListChanged event get what
you want.
But you can not use DataView on ArrayList object.

Actually, ListChanged event is a member of IBindingList, you can inherit
the ArrayList and implement IBindingList interface. Then, you can just use
ListChanged event to get you want.

There is a IBindingList implement sample in the MSDN, please refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemComponentModelIBindingListClassTopic.asp

=================================================
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Have a nice day!!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Tamir,

Do you still have any concern?
If you still have anything unclear, please feel free to tell me, I will
help you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top