0

on a form i have the following databinding. I have a binding source called JobHistoryBS that is bound to a JobHistory object which is bound to the JobHistories table in SQL Server.

On a form I have the following text fields and labels. EmployerNoTextBox and JobSiteNoTextBox. They are both bound to the appropriate properties in the binding source. Then i have two labels, Employer Name and Job Site Name. The users can enter the employer no and job site no and then the app validates what they entered and displays the associated names for the job or they can click the find button and i pop up a search form where they can search for the job site where the member works. Once the search is completed i need to take the values(EmployerNo and JobSiteNo) of the found record and update the form and the data source for that new job history record.

What is the best way to do this? Should I set the text properties of the EmployerNoTextBox and JobSiteNoTextBox or set the properties of the underlying binding source, job.EmployerNo and job.JobSiteNo? If i do either how do i tell it to refresh to make sure both the form and the binding source is in sync or is that done automatically because i have DateSourceUpdateMode set to OnPropertyChanged?

user3494389
  • 31
  • 1
  • 4

1 Answers1

0

You should update the model not the view, the view should reflect the state of the model.

T McKeown
  • 12,971
  • 1
  • 25
  • 32