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 / September 2008

Tip: Looking for answers? Try searching our database.

changing textbox.value does not change value in the db?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
A. Peters - 27 Sep 2008 13:23 GMT
Hello!
I've got a litte (but I think often asked question). How can I change
the Value of a TextBox, that the binded column is updated too?

If I wrote "testTextBox.Value = "Murks";" it doesnt change the Value in
the Database. Only when I change the value direkt in the Form.

Greetings
Alex
Morten Wennevik [C# MVP] - 29 Sep 2008 06:26 GMT
> Hello!
> I've got a litte (but I think often asked question). How can I change
[quoted text clipped - 5 lines]
> Greetings
> Alex

Hi Alex,

If changing a value in the form updates something and doing it
programmatically does not, it is probably a case of a missing notification.  
Assuming you have bound the Text property of the testTextBox you can force a
binding update.

testTextBox.DataBindings["Text"].WriteValue();

For the records, if you are updating a business object programmatically and
the changes aren't reflected on screen, have the business object implement
INotifyPropertyChanged and fire a PropertyChanged event upon property changes.

Signature

Happy Coding!
Morten Wennevik [C# MVP]


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.