Live Chat Icon For mobile
Live Chat Icon

I programatically change a bound TextBox value, but the value does not get pushed back into the bound datasource. How can I make sure the DataSource is updated

Platform: WinForms| Category: Data Binding

You can call the EndCurrentEdit method on the bindingmanager for the TextBox.

[C#]
	this.textBox1.Text = 'XXXX';   //set the value
	this.textBox1.DataBindings['Text'].BindingManagerBase.EndCurrentEdit();  //end the edit

[VB.NET]
	Me.TextBox1.Text = 'XXXX'
	Me.TextBox1.DataBindings('Text').BindingManagerBase.EndCurrentEdit()

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.