Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / February 2006

Tip: Looking for answers? Try searching our database.

How to determine if a value has changed as a result of data binding

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nik - 14 Feb 2006 09:52 GMT
Hello,

if I bind a property of a control to a field in a data source, is there
a way to know that its value has changed as a result of data binding.
For example, if I bind Text property of a TextBox, I need to know that
TextChanged event was triggered because value has just been read from
the data source, as opposed to user interaction or changing the value
from code.

Thanks.
Bart Mermuys - 14 Feb 2006 12:37 GMT
Hi,

> Hello,
>
[quoted text clipped - 4 lines]
> the data source, as opposed to user interaction or changing the value
> from code.

The TextBox itself doesn't even know it is bound.  As far as the TextBox is
concerned the Text is always changed in the same way using the Text
property.

I do believe that the Binding's Format or BindingComplete(NET2.0) event is
always fired before the Binding sets the Text.

HTH,
Greetings

> Thanks.
Nik - 14 Feb 2006 13:29 GMT
Yes, I noticed this, however it is not very practical to add an event
handler for each and every Binding object I use. It would be much
better if Binding object had 'Active' property, indicating that it is
currently pushing the value to the bound property.

Well, I suppose I will have to rewrite my app so I don't need this
functionality.

Thanks.
Bart Mermuys - 14 Feb 2006 14:42 GMT
Hi,

> Yes, I noticed this, however it is not very practical to add an event
> handler for each and every Binding object I use. It would be much
> better if Binding object had 'Active' property, indicating that it is
> currently pushing the value to the bound property.

Yeah, that sounds like a good idea.  Infact the Binding has a boolean
inPushOrPull field but it's private :-(

Thanks for the feedback,
Greetings

> Well, I suppose I will have to rewrite my app so I don't need this
> functionality.
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.