Consider this code:
txtLastModifyUserID.DataBindings.Add("Text", c_bsDataSetSource, "LastModifyUserID");
txtLastModifyUserID.Text = "1234";
Why cannot the source be updated?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The DataBinding doesn’t usually write the value until after the control starts to lose focus. Since you are updating the TextBox programmatically, the DataBinding doesn’t know there is something to update.
The way you wrote your code, you would have to call the
WriteValue()method yourself (assuming only 1 databinding exists on the TextBox):