StrataFrame Forum

Internal object and Data binding

http://forum.strataframe.net/Topic12614.aspx

By Chan - 11/11/2007

Hi,

I created an user control which contains couple of controls. I have a public property exposed to allow read/write value from/to one of my internal control, e.g TextBox.



I also implemented IBusinessBindable interface to my user control for data binding. I am having problem that, when I change any value to this internal control interactively, it doesn't update back to datasource (Business Object).



What should I do?



Thank you
By Greg McGuffey - 11/12/2007

It is probably because the BO doesn't know the property on your control was updated. I was similarly confused:



http://forum.strataframe.net/FindPost8978.aspx
By Chan - 11/13/2007

Hi,

Ya, I have this on my property. But my problem is, how could I detect changes on my internal object? My internal object is actual webbrowser. I need to be to notified if user change content of webbrowser interactively.



Any ideas?



Thank you
By Trent L. Taylor - 11/13/2007

You can create an MyPropertyNameChanged event within your user control and then raise that event when the content of the browser changes.  .NET instrinsically looks for a XXXXChanged event when bound.  So if your property name is MyProperty then you would create an event named MyPropertyChanged.  When the content of your control changes, raise this event and it should force the bindings to be refreshed.
By Chan - 11/13/2007

Hi,

Do you know which event will be fired if webbrowser control content changed?



Thank you
By StrataFrame Team - 11/13/2007

I believe it's the DocumentCompleted event.